-
-
Replying to @oleiade
There’s a crate for that: scopeguard It’s not super commonly used because Drop does that automatically!
4 replies 0 retweets 4 likes -
AFAICT: Drop is for operations that "cannot fail", right? Guessing that covers most usecases of defer though.
3 replies 0 retweets 0 likes
It’s true that it doesn’t provide a way to signal an error, but then again, neither does defer, right? If you want to handle an error, the idiom is to provide a method that takes ownership and returns a Result
2:01 PM - 5 Feb 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.