Skip to content

Commit 7527245

Browse files
committed
Make suggestion Applicability::MachineApplicable
1 parent 9a6216e commit 7527245

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clippy_lints/src/explicit_write.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10+
use crate::rustc_errors::Applicability;
1011
use crate::rustc::hir::*;
1112
use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
1213
use crate::rustc::{declare_tool_lint, lint_array};
@@ -101,7 +102,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
101102
dest_name
102103
),
103104
"try this",
104-
format!("{}{}!(\"{}\")", prefix, macro_name.replace("write", "print"), write_output.escape_default())
105+
format!("{}{}!(\"{}\")", prefix, macro_name.replace("write", "print"), write_output.escape_default()),
106+
Applicability::MachineApplicable
105107
);
106108
} else {
107109
span_lint_and_sugg(
@@ -110,7 +112,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
110112
expr.span,
111113
&format!("use of `{}().write_fmt(...).unwrap()`", dest_name),
112114
"try this",
113-
format!("{}print!(\"{}\")", prefix, write_output.escape_default())
115+
format!("{}print!(\"{}\")", prefix, write_output.escape_default()),
116+
Applicability::MachineApplicable
114117
);
115118
}
116119
} else {

0 commit comments

Comments
 (0)