There is a slight difference between the
Try operator (
?) and just returning a result. This is that the try operator will call
From::from on the error type.
I propose adding a method to
Result called something like
map_err_into that is implemented with
The main reason for adding it would not be ergonomics (the original is already pretty straightforward), but discoverability: it gives us somewhere to write about the difference between
return (either implicit or explicit), and to provide guidance along the lines of "if you want your return to work like
Try, use this method."