On 11/30/13 1:54 PM, Oren Ben-Kiki wrote:
There were several threads about this, https://mail.mozilla.org/pipermail/rust-dev/2013-October/006105.html for example. I don't see how that code can be converted to RAII at all. Sure it can be done with cells, or possibly with tuples (though, well, doing this _manually_? <<shudder>>). It really just begs for stack-allocated-once-closures.
Well, the functions `attempt_1` and `attempt_2` in that message don't do anything, so there isn't anything to convert. Do you have other specific common examples of functions that can't be converted to RAII?
`mangle` is one. `Option::map` and friends are another. Are there others? Patrick _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
