]> git.lizzy.rs Git - rust.git/commitdiff
Apply suggestions from code review
authorRicky <ricky@hosfelt.io>
Thu, 3 Dec 2020 22:44:50 +0000 (17:44 -0500)
committerGitHub <noreply@github.com>
Thu, 3 Dec 2020 22:44:50 +0000 (17:44 -0500)
updated help message for the user

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
clippy_lints/src/map_err_ignore.rs

index 324a11f140a808353de00046bd0d0a5e21b825c5..f3c0515b9bcde0e9e4522a9a517dc03e93fa8d38 100644 (file)
@@ -133,9 +133,9 @@ fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) {
                                     cx,
                                     MAP_ERR_IGNORE,
                                     body_span,
-                                    "`map_err(|_|...` ignores the original error",
+                                    "`map_err(|_|...` wildcard pattern discards the original error",
                                     None,
-                                    "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",
+                                    "Consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)",
                                 );
                             }
                         }