Pre-RFC: Catching Functions

You don’t need two changes:

fn foo() -> Result<Result<i32, String>, String> { Err("foo".into()) }

would still compile when you add try. The same is true for

fn foo() -> Option<Option<i32>> { None }

And, thinking about it, so would

fn foo() -> Option<i32> { 23.into() }

because impl<T> From<T> for T is available. Fortunately, you can’t go from a T to a Result<T, _> via Into.

I think that last one actually bothers me even more.

3 Likes