8 ms·
Yes, can't have .unwrap() in production code (it's ok in tests)
by sayrer 10mo ago
Yes, can't have .unwrap() in production code (it's ok in tests)
- orphea 10mo agoLike goto, unwrap is just a tool that has its use cases. No need to make a boogeyman out of it.
- gishh 10mo agoTo be fair, if you’re not “this tall” you really shouldn’t consider using goto in a c program. Most people aren’t that tall.
- tucnak 10mo agoNonsense. Linux kernel for one example, uses goto everywhere for error handling.
- fwjafwasd 10mo agopanicans should be using .expect() in production
- metaltyphoon 10mo agoYes it's meant to be used in test code. If you're sure it can't fail do then use .expect() that way it shows you made a choice and it wasn't just a dev oversight.
- keyle 10mo agounwrap itself isn't the problem...