2019-01-04 10:22:38 +00:00
|
|
|
// run-rustfix
|
|
|
|
|
2018-04-05 03:46:39 +00:00
|
|
|
#![allow(unused_must_use)]
|
2018-07-28 15:34:52 +00:00
|
|
|
#![warn(clippy::writeln_empty_string)]
|
2018-04-05 03:46:39 +00:00
|
|
|
use std::io::Write;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut v = Vec::new();
|
|
|
|
|
2018-08-20 13:33:43 +00:00
|
|
|
// These should fail
|
2022-01-27 14:12:45 +00:00
|
|
|
writeln!(v, "");
|
2018-04-05 03:46:39 +00:00
|
|
|
|
2018-08-20 13:33:43 +00:00
|
|
|
let mut suggestion = Vec::new();
|
2022-01-27 14:12:45 +00:00
|
|
|
writeln!(suggestion, "");
|
2018-08-20 13:33:43 +00:00
|
|
|
|
2018-04-05 03:46:39 +00:00
|
|
|
// These should be fine
|
2022-01-27 14:12:45 +00:00
|
|
|
writeln!(v);
|
|
|
|
writeln!(v, " ");
|
|
|
|
write!(v, "");
|
2018-04-05 03:46:39 +00:00
|
|
|
}
|