Skip to content

Commit

Permalink
Show doc for Ok fn
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 29, 2021
1 parent 7f5c9c4 commit 97cff68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ pub trait Context<T, E>: context::private::Sealed {
F: FnOnce() -> C;
}

/// Equivalent to `Ok::<_, anyhow::Error>(value)`.
/// Equivalent to Ok::<_, anyhow::Error>(value).
///
/// This simplifies creation of an anyhow::Result in places where type inference
/// cannot deduce the `E` type of the result &mdash; without needing to write
Expand All @@ -620,7 +620,6 @@ pub trait Context<T, E>: context::private::Sealed {
/// | |
/// | consider giving this pattern the explicit type `std::result::Result<i32, E>`, where the type parameter `E` is specified
/// ```
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Ok<T>(t: T) -> Result<T> {
Result::Ok(t)
Expand Down

0 comments on commit 97cff68

Please sign in to comment.