Skip to content

Commit

Permalink
Align naming between Ok function argument and its documentation
Browse files Browse the repository at this point in the history
The documentation refers to `Ok::<_, anyhow::Error>(value)`.
                                                    ^^^^^
  • Loading branch information
dtolnay committed Dec 3, 2024
1 parent 2081692 commit 863791a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,8 @@ 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
/// ```
#[allow(non_snake_case)]
pub fn Ok<T>(t: T) -> Result<T> {
Result::Ok(t)
pub fn Ok<T>(value: T) -> Result<T> {
Result::Ok(value)
}

// Not public API. Referenced by macro-generated code.
Expand Down

0 comments on commit 863791a

Please sign in to comment.