by ColonelPhantom · 4y ago · 0 comments
let x = match foo() {
Ok(value) -> value,
Err(e) -> return Err(e),
} let x = match foo() {
Ok(value) -> value,
Err(e) -> return Err(e.into()),
}
Which can automatically convert one error type into another when the appropriate From and/or Into impls exist.https://github.com/rust-lang/rust/blob/4e0d0d757e2f1b61ec809...