mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
27 lines
500 B
Rust
27 lines
500 B
Rust
#![allow(unused_must_use)]
|
|
#![warn(clippy::write_literal)]
|
|
|
|
use std::io::Write;
|
|
|
|
fn main() {
|
|
let mut v = Vec::new();
|
|
|
|
writeln!(v, "{}", "{hello}");
|
|
writeln!(v, r"{}", r"{hello}");
|
|
writeln!(v, "{}", '\'');
|
|
writeln!(v, "{}", '"');
|
|
writeln!(v, r"{}", '"'); // don't lint
|
|
writeln!(v, r"{}", '\'');
|
|
writeln!(
|
|
v,
|
|
"some {}",
|
|
"hello \
|
|
world!"
|
|
);
|
|
writeln!(
|
|
v,
|
|
"some {}\
|
|
{} \\ {}",
|
|
"1", "2", "3",
|
|
);
|
|
}
|