3 ms·
That's not a check at that point, though, it's an assertion that the None case is invalid. I'm not saying you should never use unwrap, but I've been burned by
by bluejekyll 6y ago
That's not a check at that point, though, it's an assertion that the None case is invalid.
I'm not saying you should never use unwrap, but I've been burned by it when treating it a little too nonchalantly. If you're implementing a lower level library, like a dns stub resolver, panicking will bring down the software using your library... which is definitely not something people are generally happy about.
Error handling isn't always the right thing, sometimes just returning Option is the correct thing.