Clean-up block whose borrows take effect only when executing the block
The Rust Programming Language Forum
Clean-up block whose borrows take effect only when executing the block
What's a way to have a panic-safe contruct similar to Java's try { ... } finally { ... } in Rust such that both the try block and the finally block mutably borrow the same thing? That is, I'm looking for something where borrows made in the try block are considered to end when execution moves out of the try block either normally or due to a panic unwind, and the borrows in the finally block start only when execution moves there. If I use scopeguard::defer!, I need to write a closure above what ...
0 comments
No comments yet.