3 ms·
Rust's Result type is a "must use" type, which makes it impossible to skip an error check.
by moosingin3space 9y ago
Rust's Result type is a "must use" type, which makes it impossible to skip an error check.
- Animats 9y agoCan you assign it to a variable and then ignore it?
- steveklabnik 9y agoYes, assignment counts as a use. That will get you an "unused variable" warning though, which you can suppress by binding to _ instead.
- Thiez 9y agoHardly impossible, just prefix the expression with `[` and suffix with `]` and the warning is gone. Or with `(` and `,)` (creating a tuple of arity one).