Fix mistakes in documentation :
- err() was meant to be employed instead of ok() - wraps comment
This commit is contained in:
parent
cebe575aad
commit
a7125b0393
@ -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 @@
|
||||
/// 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 New Issue
Block a user