logoalt Hacker News

schneemsyesterday at 5:56 AM1 replyview on HN

Wouldn't that also move any referenced variables too? Unlike the block example that would make this code not identical to what it's replacing.


Replies

pflanzeyesterday at 2:28 PM

No, unless you ask for it via the `move` keyword in front of the closure.

This works fine: https://play.rust-lang.org/?version=stable&mode=debug&editio...