mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
21 lines
372 B
Rust
21 lines
372 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!(&mut v, "");
|
|
|
|
let mut suggestion = Vec::new();
|
|
writeln!(&mut suggestion, "");
|
|
|
|
// These should be fine
|
|
writeln!(&mut v);
|
|
writeln!(&mut v, " ");
|
|
write!(&mut v, "");
|
|
}
|