When is "unwrap" idiomatic?

119 points slohobo

I was told by a few people that unwrap is always non-idiomatic in rust, but I've come to a situation in my app where I don't think it's possible to ever hit the case where error handling will ever occur.

​

So I've concluded that unwrap is idiomatic in the situation where your program shouldn't ever need to bother with that edge case and it's hard to decipher what exact error message you would write for expect, or you are writing test cases.

​

Are there other cases where unwrap is idiomatic?