3 ms·
> Why can't you clone a boxed function? I get it, Box<dyn Foo> isn't sized, so you can't clone it. Ok! ...but you can clone a closure because a raw closure is c
by bsder 4y ago
> Why can't you clone a boxed function? I get it, Box<dyn Foo> isn't sized, so you can't clone it. Ok! ...but you can clone a closure because a raw closure is clone if the contents is clone. Not when it's boxed though.
And closures in Rust can do things that "fully named functions" cannot. Let that one sink in.
- DangitBobby 4y agoThe only thing I know of is that they can enclose variables from the outer scope where named functions can't. What else?