by mcronce · 4y ago · 0 comments
Otherwise, `?` in 90% of code, with panics far up the stack, e.g. in `main()`
I don’t agree with that. To me unwrap straddles the line between “I don’t care to think about this right now” and “I don’t care about that case”.
If I can prove it does not happen then it get an “expect” with a justification. Or even a map_err(|_| unreachable!(reasoning)) if I’m feeling really fancy.
unwrap acts as a todo, I can grep for it and if I see one I know it’s something to fix.