|
|
|
|
|
by steveklabnik
3957 days ago
|
|
They could do something like let _ = something_returning_result()
But without the let, there's a warning. And culturally speaking, let _ is discouraged for this reason. If I want to ignore an error condition, I unwrap() instead, so at least my dumb decision will blow up in my face later instead of faint silently. |
|
The fact that you must acknowledge the existence of the error value before accessing the meaty success value (either with a match, an unwrap, or a try) is a great feature in Rust.
must_use forcing you to handle errors for things you don't need the meaty success value of is just icing on the cake.