Skip to content

Commit 8135ab8

Browse files
RickyRicky
Ricky
authored and
Ricky
committed
Moved map_err_ignore to restriction and updated help message
1 parent 249b6fe commit 8135ab8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/map_err_ignore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ declare_clippy_lint! {
9999
/// }
100100
/// ```
101101
pub MAP_ERR_IGNORE,
102-
pedantic,
102+
restriction,
103103
"`map_err` should not ignore the original error"
104104
}
105105

@@ -135,7 +135,7 @@ impl<'tcx> LateLintPass<'tcx> for MapErrIgnore {
135135
body_span,
136136
"`map_err(|_|...` ignores the original error",
137137
None,
138-
"Consider wrapping the error in an enum variant",
138+
"Consider wrapping the error in an enum variant for more error context, or using a named wildcard (`.map_err(|_ignored| ...`) to intentionally ignore the error",
139139
);
140140
}
141141
}

tests/ui/map_err.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | println!("{:?}", x.map_err(|_| Errors::Ignored));
55
| ^^^
66
|
77
= note: `-D clippy::map-err-ignore` implied by `-D warnings`
8-
= help: Consider wrapping the error in an enum variant
8+
= help: Consider wrapping the error in an enum variant for more error context, or using a named wildcard (`.map_err(|_ignored| ...`) to intentionally ignore the error
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)