Comment on "Useless syntax sugar": Numbered block parameters in Ruby

<- View Parent
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™.

source
Sort:hotnewtop