]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/format.fixed
iterate List by value
[rust.git] / tests / ui / format.fixed
index e4217411f0536ed6f3d8eb6bb9d4093a3c592246..306514769990d82edde8ff07ebe1780c625cb061 100644 (file)
@@ -1,6 +1,6 @@
 // run-rustfix
 
-#![allow(clippy::print_literal)]
+#![allow(clippy::print_literal, clippy::redundant_clone)]
 #![warn(clippy::useless_format)]
 
 struct Foo(pub String);
@@ -13,6 +13,7 @@ fn main() {
     "foo".to_string();
     "{}".to_string();
     "{} abc {}".to_string();
+    "foo {}\n\" bar".to_string();
 
     "foo".to_string();
     format!("{:?}", "foo"); // Don't warn about `Debug`.
@@ -59,4 +60,8 @@ fn main() {
     42.to_string();
     let x = std::path::PathBuf::from("/bar/foo/qux");
     x.display().to_string();
+
+    // False positive
+    let a = "foo".to_string();
+    let _ = Some(a + "bar");
 }