3 ms·
Ok, that argument is about as old as Rust. With one difference that now the "?" operator exists. So, quick code that doesn't care about errors can be done quit
by marcosdumay 4y ago
Ok, that argument is about as old as Rust. With one difference that now the "?" operator exists.
So, quick code that doesn't care about errors can be done quite simply by just using "?". The real place where there is a relevant use-case for unwrap is on code examples. And I am really not sure "?" is a good replacement for those, because there is a good chance that you will hit the people trying to learn from your example with a complicated type error before they even get some code to run.