about summary refs log tree commit diff
diff options
context:
space:
mode:
authorinfrandomness <infrandomness@gmail.com>2022-04-06 19:24:49 +0200
committerinfrandomness <infrandomness@gmail.com>2022-04-06 19:25:58 +0200
commita7125b0393c70c3d25feb7e063c312463694a1f6 (patch)
tree652f6eb6cfb0ca976e89a097b2e32dfbe845e9d0
parentcebe575aad4cc24401d676299e31126ea3af26f6 (diff)
downloadrust-a7125b0393c70c3d25feb7e063c312463694a1f6.tar.gz
rust-a7125b0393c70c3d25feb7e063c312463694a1f6.zip
Fix mistakes in documentation :
- err() was meant to be employed instead of ok()
- wraps comment
-rw-r--r--clippy_lints/src/methods/err_expect.rs3
-rw-r--r--clippy_lints/src/methods/mod.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/clippy_lints/src/methods/err_expect.rs b/clippy_lints/src/methods/err_expect.rs
index 887f5c1cb3b..be9d4ad94fb 100644
--- a/clippy_lints/src/methods/err_expect.rs
+++ b/clippy_lints/src/methods/err_expect.rs
@@ -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
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index 4475f8eaf59..c5c871c9d29 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -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