4 ms·
Why not use `if let` instead? Way safer
by AJRF 7y ago
Why not use `if let` instead? Way safer
- saagarjha 7y agoThe issue I'm talking about is what to do when you don't have a good idea of what to put in the "else" branch.
- mruts 7y agoA usrful error message?
- saagarjha 7y agoThis isn't always possible.
- mruts 7y agoWhy not? I always fold or map my option types. Sometimes I return None and caller handles it, sometimes I print a useful and informative error message. One should never ever directly unwrap an option value. In fact, some languages and libraries simply don’t allow it.