diff options
| author | Philipp Hansch <dev@phansch.net> | 2018-11-29 22:17:40 +0100 |
|---|---|---|
| committer | Philipp Hansch <dev@phansch.net> | 2018-12-12 07:31:04 +0100 |
| commit | 752724546a664e0fe3c2315161336d99da41c2a9 (patch) | |
| tree | 21ba6be5ec7af13d8cfb59d05b635964dcb2dfe4 | |
| parent | 9a6216ed05e353825a712c265923993b8b19d887 (diff) | |
| download | rust-752724546a664e0fe3c2315161336d99da41c2a9.tar.gz rust-752724546a664e0fe3c2315161336d99da41c2a9.zip | |
Make suggestion Applicability::MachineApplicable
| -rw-r--r-- | clippy_lints/src/explicit_write.rs | 7 |
1 files 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 { |
