Could `std::Result<T, E1>` implement `From<Result<T, E2>>` where `E2: Into<E1>`? It would mean being able to write `r.into()` rather than `r.map_err(Into::into)`.
2
9
I bet it falls foul of some specialisation rule or something.
2
Replying to @nick_r_cameron
I imagine this is something that try blocks and ? might make a bit less messy in the future.

Dec 16, 2019 ยท 9:41 PM UTC

1
Replying to @dsilverstone
If you can use a ? today, it's fine, but sometimes you just want an unconditional return, and then you have to use the map_err incantation, which sucks.
1