Simplify `Try` for better code reuse

I think it would be a good idea to “deprecate” (remove) Try::from_ok in favor of .into(), and have From<T> for Result<T, E>.

I can’t think of any case where this can be an issue. We just need to add an additional constraint on Try: where Self::Ok: Into<Self>, maybe? (I’m not sure if this constraint is correct)

This keeps Try simpler and encourages code reuse. Code reuse is a big deal for me, as it keeps implementations simple, without affecting expressive power. (Personally I can’t come up with a case where you can’t use Try + into as a replacement for Try + from_ok)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.