3 ms·
I'm sure I'm not the first (or the hundredth) to say this, but `unwrap` has always struck me as a horribly innocuous spelling of "yes, feel free to crash here".
by mrec 12y ago
I'm sure I'm not the first (or the hundredth) to say this, but `unwrap` has always struck me as a horribly innocuous spelling of "yes, feel free to crash here".
I presume there is (or could be) a standard lint to prevent this getting into production code, but it still feels kind of icky.
- steveklabnik 12y agoWe almost changed it to `assert` but that made some people _really_ upset.
- rat87 12y agoDammit, I kept wondering why it wasn't named unwrap_or_panic/unwrap_or_assert but it could be worse at least unwrap is a less friendly name then scala's get.
- deleted 12y ago[deleted]
- Manishearth 12y ago`.expect()` is slightly better (you can give it a string that will become a part of the panic message)