TIL: use `expect("message")` instead of `unwrap()` to error with a custom message in @rustlang
brb never using unwrap again
-
-
congratulations, you have unlocked a STYLISTIC HOLY WAR
1 reply 3 retweets 27 likes -
Replying to @Gankra_ @steveklabnik and
.expect("foo") is like assert("foo"), .unwrap() is like assert(0).
1 reply 0 retweets 1 like
There was a proposal to rename unwrap to assert but it didn't land
9:54 AM - 25 Apr 2017
0 replies
0 retweets
4 likes
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.