Skip to content

Commit

Permalink
Change lint name
Browse files Browse the repository at this point in the history
From `suggest_print` to `explicit_write`
  • Loading branch information
devonhollowood committed Oct 15, 2017
1 parent a46bf3f commit aeeb38d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
serde_api::SERDE_API_MISUSE,
should_assert_eq::SHOULD_ASSERT_EQ,
strings::STRING_LIT_AS_BYTES,
suggest_print::SUGGEST_PRINT,
suggest_print::EXPLICIT_WRITE,
swap::ALMOST_SWAPPED,
swap::MANUAL_SWAP,
temporary_assignment::TEMPORARY_ASSIGNMENT,
Expand Down
8 changes: 4 additions & 4 deletions clippy_lints/src/suggest_print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use utils::opt_def_id;
/// writeln!(&mut io::stderr(), "foo: {:?}", bar).unwrap();
/// ```
declare_lint! {
pub SUGGEST_PRINT,
pub EXPLICIT_WRITE,
Warn,
"using `write!()` family of functions instead of `print!()` family of \
functions, when using the latter would work"
Expand All @@ -27,7 +27,7 @@ pub struct Pass;

impl LintPass for Pass {
fn get_lints(&self) -> LintArray {
lint_array!(SUGGEST_PRINT)
lint_array!(EXPLICIT_WRITE)
}
}

Expand Down Expand Up @@ -74,7 +74,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
if let Some(macro_name) = calling_macro {
span_lint(
cx,
SUGGEST_PRINT,
EXPLICIT_WRITE,
expr.span,
&format!(
"use of `{}!({}(), ...).unwrap()`. Consider using `{}{}!` instead",
Expand All @@ -87,7 +87,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
} else {
span_lint(
cx,
SUGGEST_PRINT,
EXPLICIT_WRITE,
expr.span,
&format!(
"use of `{}().write_fmt(...).unwrap()`. Consider using `{}print!` instead",
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/suggest_print.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![warn(suggest_print)]
#![warn(explicit_write)]


fn stdout() -> String {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/suggest_print.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: use of `write!(stdout(), ...).unwrap()`. Consider using `print!` instead
16 | write!(std::io::stdout(), "test").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D suggest-print` implied by `-D warnings`
= note: `-D explicit-write` implied by `-D warnings`

error: use of `write!(stderr(), ...).unwrap()`. Consider using `eprint!` instead
--> $DIR/suggest_print.rs:17:9
Expand Down

0 comments on commit aeeb38d

Please sign in to comment.