Comment on Don't unwrap options: There are better ways (2024)parentComments−p1necone1yImo always expect rather than unwrap in those cases. If it's justifiable, you should justify it in the message.("This should never happen because: ..., if you see this message there's a bug.")−Arnavion1yOr let-else with a panic!() in the else {} if you want to use a format string.−xigoi1yIf you’re doing something like Project Euler, writing error messages is a waste of time.
Comments
Imo always expect rather than unwrap in those cases. If it's justifiable, you should justify it in the message.
("This should never happen because: ..., if you see this message there's a bug.")
Or let-else with a panic!() in the else {} if you want to use a format string.
If you’re doing something like Project Euler, writing error messages is a waste of time.