4 ms·
In rust, errors are difficult to ignore (you need to either allow compiler warnings, which AFAICT nobody sane does, or write something like `let _ = my_fallible
by umanwizard 6y ago
In rust, errors are difficult to ignore (you need to either allow compiler warnings, which AFAICT nobody sane does, or write something like `let _ = my_fallible_function();` which makes the intent to ignore the error explicit).
Perhaps more fundamental: it’s impossible to accidentally use an uninitialized “success” return value when the function actually failed, which is easy to do in C, C++, Go, etc.
- ori_b 6y agoOr .unwrap(), which I see relatively often.
- umanwizard 6y agoThat’s not ignoring errors, it’s explicitly choosing what to do in case of one (crash).