2018-04-04 22:46:39 -05:00
|
|
|
#![allow(unused_must_use)]
|
2018-07-28 10:34:52 -05:00
|
|
|
#![warn(clippy::writeln_empty_string)]
|
2018-04-04 22:46:39 -05:00
|
|
|
use std::io::Write;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut v = Vec::new();
|
|
|
|
|
2018-08-20 08:33:43 -05:00
|
|
|
// These should fail
|
2022-01-11 13:31:35 -06:00
|
|
|
writeln!(v, "");
|
2018-04-04 22:46:39 -05:00
|
|
|
|
2018-08-20 08:33:43 -05:00
|
|
|
let mut suggestion = Vec::new();
|
2022-01-11 13:31:35 -06:00
|
|
|
writeln!(suggestion, "");
|
2018-08-20 08:33:43 -05:00
|
|
|
|
2018-04-04 22:46:39 -05:00
|
|
|
// These should be fine
|
2022-01-11 13:31:35 -06:00
|
|
|
writeln!(v);
|
|
|
|
writeln!(v, " ");
|
|
|
|
write!(v, "");
|
2018-04-04 22:46:39 -05:00
|
|
|
}
|