mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 19:43:20 +00:00
a7fa2a6fa8
Don't lint on a mixture of raw and regular strings Fix spans in format strings
27 lines
540 B
Rust
27 lines
540 B
Rust
#![allow(unused_must_use)]
|
|
#![warn(clippy::write_literal)]
|
|
|
|
use std::io::Write;
|
|
|
|
fn main() {
|
|
let mut v = Vec::new();
|
|
|
|
writeln!(&mut v, "{}", "{hello}");
|
|
writeln!(&mut v, r"{}", r"{hello}");
|
|
writeln!(&mut v, "{}", '\'');
|
|
writeln!(&mut v, "{}", '"');
|
|
writeln!(&mut v, r"{}", '"'); // don't lint
|
|
writeln!(&mut v, r"{}", '\'');
|
|
writeln!(
|
|
&mut v,
|
|
"some {}",
|
|
"hello \
|
|
world!"
|
|
);
|
|
writeln!(
|
|
&mut v,
|
|
"some {}\
|
|
{} \\ {}",
|
|
"1", "2", "3",
|
|
);
|
|
}
|