3 ms·
Actually, even though in the language spec that usage is refered to as a "closure", when configured for a release build, that will compile to exactly the same c
by adrusi 11y ago
Actually, even though in the language spec that usage is refered to as a "closure", when configured for a release build, that will compile to exactly the same code as if you had written a static funtion and passed a pointer to it.
Rust is very good at optimizing away closures to have as little overhead as is possible for the semantics they describe.