Result.expect_err, but not
I understand that the three methods above are used for unwrapping the underlying value, but for functions that return
(), unwrapping is a convenient way to panic upon unexpected returns.
Right now, to panic if a function doesn’t return
None, I have to wrap it with
assert!(expr_that_returns_option.is_none(), "Error message").
It would be much more readable, convenient and motivating to add sanity checks if an
expect_none() is introduced.