2 ms·
> You'd like for this to optimize down to a function call, without saving any state from the outer scope. Don't know if Rust does this yet. My (limited) unders
by tatterdemalion 11y ago
> You'd like for this to optimize down to a function call, without saving any state from the outer scope. Don't know if Rust does this yet.
My (limited) understanding is that all bindings closed over by a closure are represented as anonymous struct passed to the function, if nothing is closed over that will be a unit struct which will of course be optimized to nothing.