Closed
Description
We're incorrectly suggesting wrapping with Ok()
when it won't help:
error[E0308]: try expression alternatives have incompatible types
-->
|
503 | / segments
504 | | .next()
505 | | .ok_or(ApplicationIssue::InvalidMessage(foo::Error::InvalidHeader))?
| |________________________________________________________________________^ expected struct `failure::Error`, found enum `foo::Error`
|
= note: expected type `std::result::Result<_, failure::Error>`
found type `std::result::Result<_, foo::Error>`
help: try wrapping with a success variant
|
503 | Ok(segments
504 | .next()
505 | .ok_or(ApplicationIssue::InvalidMessage(foo::Error::InvalidHeader))?)
It should be suggesting using using map_err
instead.