2019-01-04 04:22:38 -06:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![allow(unused_must_use)]
|
|
|
|
#![warn(clippy::writeln_empty_string)]
|
|
|
|
use std::io::Write;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut v = Vec::new();
|
|
|
|
|
|
|
|
// These should fail
|
2022-01-11 13:31:35 -06:00
|
|
|
writeln!(v);
|
2019-01-04 04:22:38 -06:00
|
|
|
|
|
|
|
let mut suggestion = Vec::new();
|
2022-01-11 13:31:35 -06:00
|
|
|
writeln!(suggestion);
|
2019-01-04 04:22:38 -06:00
|
|
|
|
|
|
|
// These should be fine
|
2022-01-11 13:31:35 -06:00
|
|
|
writeln!(v);
|
|
|
|
writeln!(v, " ");
|
|
|
|
write!(v, "");
|
2019-01-04 04:22:38 -06:00
|
|
|
}
|