what's the rust function that's like fn(Vec<Option<T>>) -> Vec<T>, where only values of Some(T) are kept
-
-
Replying to @mountain_ghosts
std::fmt::identity + filter_map: let filtered = iter.filter_map(identity).collect::<Vec<_>>() https://doc.rust-lang.org/std/convert/fn.identity.html …
1 reply 0 retweets 2 likes -
Replying to @yoshuawuyts @mountain_ghosts
isn't this just .flatten().collect()?
1 reply 0 retweets 3 likes
Replying to @eddyb_r @mountain_ghosts
Heh, wasn't aware that was a thing you could do. Nice!
5:33 PM - 3 Apr 2019
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.