]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/writeln_empty_string.rs
iterate List by value
[rust.git] / tests / ui / writeln_empty_string.rs
index c7092eb8c4b00fbdaf6df8131558856a4dc3cf69..9a8894b6c0d3285b2a3a07ed6b7ecdaec4094658 100644 (file)
@@ -1,16 +1,20 @@
+// run-rustfix
+
 #![allow(unused_must_use)]
-#![warn(writeln_empty_string)]
+#![warn(clippy::writeln_empty_string)]
 use std::io::Write;
 
 fn main() {
     let mut v = Vec::new();
 
-    // This should fail
+    // 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, "");
-
 }