From 752724546a664e0fe3c2315161336d99da41c2a9 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 29 Nov 2018 22:17:40 +0100 Subject: [PATCH] Make suggestion Applicability::MachineApplicable --- clippy_lints/src/explicit_write.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/explicit_write.rs b/clippy_lints/src/explicit_write.rs index 79c4c5f0530..8c3c8461504 100644 --- a/clippy_lints/src/explicit_write.rs +++ b/clippy_lints/src/explicit_write.rs @@ -7,6 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use crate::rustc_errors::Applicability; use crate::rustc::hir::*; use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use crate::rustc::{declare_tool_lint, lint_array}; @@ -101,7 +102,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { dest_name ), "try this", - format!("{}{}!(\"{}\")", prefix, macro_name.replace("write", "print"), write_output.escape_default()) + format!("{}{}!(\"{}\")", prefix, macro_name.replace("write", "print"), write_output.escape_default()), + Applicability::MachineApplicable ); } else { span_lint_and_sugg( @@ -110,7 +112,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { expr.span, &format!("use of `{}().write_fmt(...).unwrap()`", dest_name), "try this", - format!("{}print!(\"{}\")", prefix, write_output.escape_default()) + format!("{}print!(\"{}\")", prefix, write_output.escape_default()), + Applicability::MachineApplicable ); } } else {