Skip to content
Myr

Show doc for Ok fn

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 7f5c9c4 · Browse files · 1 file+1 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−2 removed

  • other:+1 added−2 removed

1 file+1 added−2 removed

modified:src/lib.rs+1 added-2 removed
600 unmodified lines
601 C: Display + Send + Sync + 'static,602 F: FnOnce() -> C;603}604605/// Equivalent to `Ok::<_, anyhow::Error>(value)`.605/// Equivalent to Ok::<_, anyhow::Error>(value).606///607/// This simplifies creation of an anyhow::Result in places where type inference608/// cannot deduce the `E` type of the result &mdash; without needing to write609/// `Ok::<_, anyhow::Error>(value)`.
9 unmodified lines
619/// | - ^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `E` declared on the enum `Result`620/// | |621/// | consider giving this pattern the explicit type `std::result::Result<i32, E>`, where the type parameter `E` is specified622/// ```623#[doc(hidden)]623#[allow(non_snake_case)]624pub fn Ok<T>(t: T) -> Result<T> {625 Result::Ok(t)626}
39 unmodified lines