When returning Result<_, A> but Result<_, B> is expected and A: Into<B>, provide a suggestion to return Ok(x?) instead:
error[E0308]: mismatched types
--> src/bin/ruby-stacktrace.rs:86:20
|
86 | return version;
| ^^^^^^^ expected struct `failure::Error`, found enum `ruby_stacktrace::address_finder::AddressFinderError`
|
= note: expected type `std::result::Result<_, failure::Error>`
found type `std::result::Result<_, ruby_stacktrace::address_finder::AddressFinderError>`
= help: because `ruby_stacktrace::address_finder::AddressFinderError` implements `failure::Error`, you can use `?` to coerce it:
|
86 | return Ok(version?);
| ^^^^^^^^^^^^
Case taken from https://jvns.ca/blog/2018/01/13/rust-in-2018--way-easier-to-use/
When returning
Result<_, A>butResult<_, B>is expected andA: Into<B>, provide a suggestion to returnOk(x?)instead:Case taken from https://jvns.ca/blog/2018/01/13/rust-in-2018--way-easier-to-use/