Earlier quoted context omitted.
.unwrap() is only the right choice if you need to optimize for binary size and can't afford the cost of the precise error message you would pass to .expect(). There are situations where you can't possibly continue running the application if an error occurs, but you shouldn't rely on a backtrace (which you might not manage to capture, e.g. if RUST_BACKTRACE is unset or you don't have symbols) as your only method of co…
I can't reply to steveklabnik for some reason. But I think if let would replace that unwrap he uses there.
I mention in the post that this specific code would be best written with if let, but that it's not about the specifics, it's about the general pattern.