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