Update clippy_lints/src/unwrap.rs

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
This commit is contained in:
Matthias Krüger 2020-08-10 23:50:52 +02:00
parent c514ff0c93
commit 1b46e485b2

View File

@ -181,8 +181,8 @@ impl<'a, 'tcx> Visitor<'tcx> for UnwrappableVariablesVisitor<'a, 'tcx> {
self.cx,
UNNECESSARY_UNWRAP,
expr.span,
&format!("you checked before that `{}()` cannot fail. \
Instead of checking and unwrapping, it's better to use `if let` or `match`",
&format!("you checked before that `{}()` cannot fail, \
instead of checking and unwrapping, it's better to use `if let` or `match`",
method_name.ident.name),
|diag| { diag.span_label(unwrappable.check.span, "the check is happening here"); },
);