Hands up: do we want a shorthand like this in @rustlang :
[Some(42)].iter().map(match {
Some(x) => x,
None => 0
}).collect();
-
-
I meant using match like a free function without naming a variable
-
So you mean basically just shortening `|x| match x {...}` into `match {...}`? I personally don't like too much sugar and increased language complexity for so little net win.
- 1 more reply
New conversation -
-
-
Another goodie. unwrap_or_default() for types that impl Default
-
my example probably was to ambiguous
End of conversation
New conversation -
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.