// run-rustfix
-#![allow(clippy::print_literal)]
+#![allow(clippy::print_literal, clippy::redundant_clone)]
#![warn(clippy::useless_format)]
struct Foo(pub String);
format!("foo");
format!("{{}}");
format!("{{}} abc {{}}");
+ format!(
+ r##"foo {{}}
+" bar"##
+ );
format!("{}", "foo");
format!("{:?}", "foo"); // Don't warn about `Debug`.
format!("{}", 42.to_string());
let x = std::path::PathBuf::from("/bar/foo/qux");
format!("{}", x.display().to_string());
+
+ // False positive
+ let a = "foo".to_string();
+ let _ = Some(format!("{}", a + "bar"));
}