Skip to content

Commit 9c2e632

Browse files
committed
Fix mistakes in documentation :
- err() was meant to be employed instead of ok() - wraps comment
1 parent 5c94567 commit 9c2e632

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clippy_lints/src/methods/err_expect.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ pub(super) fn check(
1919
) {
2020
if_chain! {
2121
if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(recv), sym::Result);
22-
// 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)
22+
// Test the version to make sure the lint can be showed (expect_err has been
23+
// introduced in rust 1.17.0 : https://github.com/rust-lang/rust/pull/38982)
2324
if meets_msrv(msrv, &msrvs::EXPECT_ERR);
2425

2526
// Grabs the `Result<T, E>` type

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ declare_clippy_lint! {
368368
/// Checks for `.err().expect()` calls on the `Result` type.
369369
///
370370
/// ### Why is this bad?
371-
/// `.expect_err()` can be called directly to avoid the extra type conversion from `ok()`.
371+
/// `.expect_err()` can be called directly to avoid the extra type conversion from `err()`.
372372
///
373373
/// ### Example
374374
/// ```should_panic

0 commit comments

Comments
 (0)