3 ms·
And if your callers are generic over the error type, and so they do have code for handling errors, the compiler won't emit this code for your result type becaus
by tialaramex 1mo ago
And if your callers are generic over the error type, and so they do have code for handling errors, the compiler won't emit this code for your result type because you've said its error type can't exist.
- tyre 1mo agoDoes that mean you can assign the result of the function without explicitly unwrapping? Or that the compiler removes the call to unwrap? Or neither?
- bonzini 1mo agoYou need to unwrap but the compiler removes the call. If instead you know that the callee is infallible you can also do let Ok(x) = call_that_cant_fail();