Fix mistakes in documentation :

- err() was meant to be employed instead of ok()
- wraps comment
This commit is contained in:
infrandomness 2022-04-06 19:24:49 +02:00
parent cebe575aad
commit a7125b0393
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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