- For
T: Clone
, what is the idiomatic way t ogo fromOption<&T>
toOption<T>
?
I suggest o.map(|ref t| t.clone())
1 Like
There's .cloned()
on options and iterators.
7 Likes
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.