>> What's wrong with e.g.:
>> foo().if_some!(|x| { doSomethingWith(x) })?

>At least you cant "break" or "return" (from outer function). Also borrow
rules sometimes are more complex when using closure.

Good point; I forgot about flow control. 

But this makes me ask: Should there be a way to inline functions including
closure arguments? That'd not only be a performance improvement (from 
empirical work with other languages inlining) but allow a lot of 
flexibility. It'd allow the syntax of closures, without any tradeoffs.

-Michael
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to