53
[BLOG] Why Rust mutexes look like they do - Cliffle
(cliffle.com)
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Credits
Best practice when using
.unwrap()in production code is to put a line of documentation immediately above the use of.unwrap()that describes the safety invariants which allow the unwrap to be safe.Since code churn could eventually cause those safety invariants to be violated, I think it's not a bad thing for a blunt audit of
.unwrap()to bring your attention to those cases and prompt to reevaluate if the invariants are still satisfied.