Let V be some collection class, say, HashMap, HashSet, Vec, ...
Consider:
coll: Option<V<T>>;
Is there a simple way to do a "coll.iter" where
Some(lst) => iter over lst.iter()
None => some iter that is empty
Let V be some collection class, say, HashMap, HashSet, Vec, ...
Consider:
coll: Option<V<T>>;
Is there a simple way to do a "coll.iter" where
Some(lst) => iter over lst.iter()
None => some iter that is empty
coll.iter().flatten()
coll.iter().flatten()
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.