Skip to content

Commit a11fc56

Browse files
committed
Change lint name to expect_err
1 parent 5166a3b commit a11fc56

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

clippy_lints/src/methods/expect_err.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::EXPECT_ERR;
1+
use super::ERR_EXPECT;
22
use clippy_utils::{diagnostics::span_lint_and_help, meets_msrv, msrvs, ty::is_type_diagnostic_item};
33
use rustc_lint::LateContext;
44
use rustc_semver::RustcVersion;
@@ -8,7 +8,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &rustc_hir::Expr<'_>, recv: &rus
88
if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(recv), sym::Result) & meets_msrv(msrv, &msrvs::EXPECT_ERR) {
99
span_lint_and_help(
1010
cx,
11-
EXPECT_ERR,
11+
ERR_EXPECT,
1212
expr.span,
1313
"called `.err().expect()` on a `Result` value",
1414
None,

clippy_lints/src/methods/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ declare_clippy_lint! {
370370
/// ### Why is this bad?
371371
/// Because .expect_err() can be called directly.
372372
#[clippy::version = "1.61.0"]
373-
pub EXPECT_ERR,
373+
pub ERR_EXPECT,
374374
style,
375375
r#"using `.err().expect("")` when `.expect_err("")` can be used"#
376376
}
@@ -2178,7 +2178,7 @@ impl_lint_pass!(Methods => [
21782178
NEEDLESS_SPLITN,
21792179
UNNECESSARY_TO_OWNED,
21802180
UNNECESSARY_JOIN,
2181-
EXPECT_ERR,
2181+
ERR_EXPECT,
21822182
]);
21832183

21842184
/// Extracts a method call name, args, and `Span` of the method name.

tests/ui/expect_err.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: called `.err().expect()` on a `Result` value
44
LL | x.err().expect("Testing expect_err");
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `-D clippy::expect-err` implied by `-D warnings`
7+
= note: `-D clippy::err-expect` implied by `-D warnings`
88
= help: `.expect_err()` can be called instead
99

1010
error: aborting due to previous error

0 commit comments

Comments
 (0)