Comment on "Useless syntax sugar": Numbered block parameters in Ruby
colonial@lemmy.world 1 year agoIt wouldn’t be as relevant, since passing a function or method instead of a closure is much easier in Rust - you can just name it, while Ruby requires you to use the method
method.
So instead of .map(|res| res.unwrap())
you can do .map(Result::unwrap)
and it’ll Just Work™.
jendrik@discuss.tchncs.de 1 year ago
Except when Type::Method takes a reference, then it doesn’t just work