]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/question_mark.rs
Use span_suggestion_with_applicability instead of span_suggestion
[rust.git] / clippy_lints / src / question_mark.rs
index 93ea00cec77deeea98e554ff5f34b92d5c195a94..f4920e52a71035fad9f6972a49680560ba2babf8 100644 (file)
@@ -8,6 +8,7 @@
 
 use crate::utils::{match_def_path, match_type, span_lint_and_then};
 use crate::utils::paths::*;
+use crate::rustc_errors::Applicability;
 
 /// **What it does:** Checks for expressions that could be replaced by the question mark operator
 ///
@@ -70,10 +71,11 @@ fn check_is_none_and_early_return_none(cx: &LateContext<'_, '_>, expr: &Expr) {
                     |db| {
                         let receiver_str = &Sugg::hir(cx, subject, "..");
 
-                        db.span_suggestion(
+                        db.span_suggestion_with_applicability(
                             expr.span,
                             "replace_it_with",
                             format!("{}?;", receiver_str),
+                            Applicability::Unspecified,
                         );
                     }
                 )