You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This simplifies creation of an anyhow::Result in places where type inference cannot deduce the E type of the result — without needing to write Ok::<_, anyhow::Error>(value).
One might think that anyhow::Result::Ok(value) would work in such cases but it does not.
error[E0282]: type annotations needed for `std::result::Result<i32, E>` --> src/main.rs:11:13 |11 | let _ = anyhow::Result::Ok(1); | - ^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `E` declared on the enum `Result` | | | consider giving this pattern the explicit type `std::result::Result<i32, E>`, where the type parameter `E` is specified
The text was updated successfully, but these errors were encountered:
This simplifies creation of an anyhow::Result in places where type inference cannot deduce the
E
type of the result — without needing to writeOk::<_, anyhow::Error>(value)
.One might think that
anyhow::Result::Ok(value)
would work in such cases but it does not.The text was updated successfully, but these errors were encountered: