Skip to content

Commit 98a0d1d

Browse files
committed
Make match_wild_err_arm pedantic, and update help messages
1 parent e214ea8 commit 98a0d1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/matches.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ declare_clippy_lint! {
168168
/// **What it does:** Checks for arm which matches all errors with `Err(_)`
169169
/// and take drastic actions like `panic!`.
170170
///
171-
/// **Why is this bad?** It is generally a bad practice, just like
171+
/// **Why is this bad?** It is generally a bad practice, similar to
172172
/// catching all exceptions in java with `catch(Exception)`
173173
///
174174
/// **Known problems:** None.
@@ -182,7 +182,7 @@ declare_clippy_lint! {
182182
/// }
183183
/// ```
184184
pub MATCH_WILD_ERR_ARM,
185-
style,
185+
pedantic,
186186
"a `match` with `Err(_)` arm and take drastic actions"
187187
}
188188

@@ -676,7 +676,7 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[Arm<'_>])
676676
arm.pat.span,
677677
&format!("`Err({})` matches all errors", &ident_bind_name),
678678
None,
679-
"match each error separately or use the error output",
679+
"match each error separately or use the error output, or use `.except(msg)` if the error case is unreachable",
680680
);
681681
}
682682
}

0 commit comments

Comments
 (0)