Re:Bitwarden compatible server written in Rust
by JeremyNT on Thursday December 23, 2021 @09:45PM
(#29669445)
I learned rust before go and I was shocked by the (lack of) error handling in go.
unwrap feels lazy, but it's obvious what is doing and it's impossible to do nothing. With go error handling is entirely optional.
It's easy and idiomatic to write code which calls `unwrap`, so that's what everybody does when they don't want or need to write sophisticated error handling code. But that's not the same as forgetting to check a return value — when something goes wrong, `unwrap` panics.
I mean, if you're determined you can definitely drop an error in Rust, e.g. with a `match` arm that does nothing. But the easy path is to `unwrap`.