]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/needless_borrowed_ref.rs
Use span_suggestion_with_applicability instead of span_suggestion
[rust.git] / clippy_lints / src / needless_borrowed_ref.rs
index 2db9b9d165bf634e0b2264aec93fafc511eadb59..08ce0de21c6f531372ed70b36be848277524ee14 100644 (file)
@@ -7,6 +7,7 @@
 use if_chain::if_chain;
 use crate::rustc::hir::{BindingAnnotation, MutImmutable, Pat, PatKind};
 use crate::utils::{in_macro, snippet, span_lint_and_then};
+use crate::rustc_errors::Applicability;
 
 /// **What it does:** Checks for useless borrowed references.
 ///
@@ -77,7 +78,12 @@ fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
                                    "this pattern takes a reference on something that is being de-referenced",
                                    |db| {
                                        let hint = snippet(cx, spanned_name.span, "..").into_owned();
-                                       db.span_suggestion(pat.span, "try removing the `&ref` part and just keep", hint);
+                                       db.span_suggestion_with_applicability(
+                                            pat.span, 
+                                            "try removing the `&ref` part and just keep",
+                                            hint,
+                                            Applicability::Unspecified,
+                                            );
                                    });
             }
         }