2018-04-04 22:46:39 -05:00
|
|
|
#![allow(unused_must_use)]
|
|
|
|
#![warn(writeln_empty_string)]
|
|
|
|
use std::io::Write;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut v = Vec::new();
|
|
|
|
|
2018-08-20 08:33:43 -05:00
|
|
|
// These should fail
|
2018-04-04 22:46:39 -05:00
|
|
|
writeln!(&mut v, "");
|
|
|
|
|
2018-08-20 08:33:43 -05:00
|
|
|
let mut suggestion = Vec::new();
|
|
|
|
writeln!(&mut suggestion, "");
|
|
|
|
|
2018-04-04 22:46:39 -05:00
|
|
|
// These should be fine
|
|
|
|
writeln!(&mut v);
|
|
|
|
writeln!(&mut v, " ");
|
|
|
|
write!(&mut v, "");
|
|
|
|
|
|
|
|
}
|