mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
Fix mistakes in documentation :
- err() was meant to be employed instead of ok() - wraps comment
This commit is contained in:
parent
cebe575aad
commit
a7125b0393
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue