logoalt Hacker News

saghmyesterday at 3:27 AM2 repliesview on HN

My instinct is this would get hairy much faster if you want to actually close over variables compared to using a block.


Replies

ahartmetzyesterday at 5:24 AM

Not sure if that is relevant to your point, but: For better and for worse, closing over any outer scope variables is syntactically free in Rust lambdas. You just access them.

show 1 reply
loegyesterday at 4:21 AM

If the verbose return type syntax can't be elided, I think it's more or less dead as a pattern.