Another standard library awesomeness:

How to add things to an iterator if you have Some(&things)?



That's pure awesomeness!

· · Web · 1 · 1 · 1

@musicmatze Nice one!

Even easier, if you have:
let things: Option<T> = Some(T);

and a collection like Vec<T>, HashSet<T> etc. (everything that implements `Extend`):

Just do:

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!