mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
19 lines
349 B
Rust
19 lines
349 B
Rust
#![allow(unused_must_use)]
|
|
#![warn(writeln_empty_string)]
|
|
use std::io::Write;
|
|
|
|
fn main() {
|
|
let mut v = Vec::new();
|
|
|
|
// These should fail
|
|
writeln!(&mut v, "");
|
|
|
|
let mut suggestion = Vec::new();
|
|
writeln!(&mut suggestion, "");
|
|
|
|
// These should be fine
|
|
writeln!(&mut v);
|
|
writeln!(&mut v, " ");
|
|
write!(&mut v, "");
|
|
|
|
}
|