Moved map_err_ignore to restriction and updated help message

This commit is contained in:
Ricky 2020-12-03 16:11:52 -05:00
parent 249b6fee91
commit 8135ab8a22
2 changed files with 3 additions and 3 deletions

View File

@ -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",
);
}
}

View File

@ -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