Why this fires¶
recover unwraps the success value of the standard Result<T, E> and handles
its error payload. The operand must have a proved standard Result type. An
ordinary value, any, or a user-defined enum named Result cannot be recovered.
let value = 42 recover { _ => 0 } // TE183Fix it¶
Apply recovery to an actual Result returned by your operation:
fn value(result: Result<int, str>) -> int {
result recover { _ => 0 }
}Use match for an unrelated enum, including a user-defined Result.