Skip to content

Commit

Permalink
Fix mistakes in documentation :
Browse files Browse the repository at this point in the history
- err() was meant to be employed instead of ok()
- wraps comment
  • Loading branch information
b-ncMN committed Apr 6, 2022
1 parent cebe575 commit a7125b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion clippy_lints/src/methods/err_expect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ pub(super) fn check(
) {
if_chain! {
if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(recv), sym::Result);
// Test the version to make sure the lint can be showed (expect_err has been introduced in rust 1.17.0 : https://github.com/rust-lang/rust/pull/38982)
// Test the version to make sure the lint can be showed (expect_err has been
// introduced in rust 1.17.0 : https://github.com/rust-lang/rust/pull/38982)
if meets_msrv(msrv, &msrvs::EXPECT_ERR);

// Grabs the `Result<T, E>` type
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ declare_clippy_lint! {
/// Checks for `.err().expect()` calls on the `Result` type.
///
/// ### Why is this bad?
/// `.expect_err()` can be called directly to avoid the extra type conversion from `ok()`.
/// `.expect_err()` can be called directly to avoid the extra type conversion from `err()`.
///
/// ### Example
/// ```should_panic
Expand Down

0 comments on commit a7125b0

Please sign in to comment.