&gt; You&#x27;d like for this to optimize down to a function call, without saving any state from the outer scope. Don&#x27;t know if Rust does this yet.<p>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.