mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 09:03:18 +00:00
17 lines
275 B
Rust
17 lines
275 B
Rust
|
#![allow(unused_must_use)]
|
||
|
#![warn(writeln_empty_string)]
|
||
|
use std::io::Write;
|
||
|
|
||
|
fn main() {
|
||
|
let mut v = Vec::new();
|
||
|
|
||
|
// This should fail
|
||
|
writeln!(&mut v, "");
|
||
|
|
||
|
// These should be fine
|
||
|
writeln!(&mut v);
|
||
|
writeln!(&mut v, " ");
|
||
|
write!(&mut v, "");
|
||
|
|
||
|
}
|