Moved map_err_ignore to restriction and updated help message
This commit is contained in:
parent
249b6fee91
commit
8135ab8a22
@ -99,7 +99,7 @@
|
||||
/// }
|
||||
/// ```
|
||||
pub MAP_ERR_IGNORE,
|
||||
pedantic,
|
||||
restriction,
|
||||
"`map_err` should not ignore the original error"
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) {
|
||||
body_span,
|
||||
"`map_err(|_|...` ignores the original error",
|
||||
None,
|
||||
"Consider wrapping the error in an enum variant",
|
||||
"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",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ LL | println!("{:?}", x.map_err(|_| Errors::Ignored));
|
||||
| ^^^
|
||||
|
|
||||
= note: `-D clippy::map-err-ignore` implied by `-D warnings`
|
||||
= help: Consider wrapping the error in an enum variant
|
||||
= 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
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user