3 ms·
https://doc.rust-lang.org/book/closures.html#closures-and-their-environment https://doc.rust-lang.org/book/closures.html#closures-and-th... Doesn't seem too cr
by k__ 10y ago
https://doc.rust-lang.org/book/closures.html#closures-and-their-environment https://doc.rust-lang.org/book/closures.html#closures-and-th...
Doesn't seem too crazy, as long as you don't want to mutate the variables the function closed over.
- Manishearth 10y agoMutating isn't hard either, and if it does get hard you can stick things in a Cell or RefCell.
- k__ 10y agoIt' not hard, it's just a bit more code than in JavaScript :)