I’m glad it doesnt.
Comment on "Useless syntax sugar": Numbered block parameters in Ruby
twelvefloatinghands@lemmy.world 1 year ago
Damn, I wish rust had that
TheCee@programming.dev 1 year ago
paperplane@lemmy.world 1 year ago
Swift does, though using the dollar sign rather than underscores
Anders429@programming.dev 1 year ago
I sincerely doubt Rust would ever add something like this.
colonial@lemmy.world 1 year ago
It 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