2021-03-25 13:29:11 -05:00
|
|
|
#![allow(unused_must_use)]
|
|
|
|
#![warn(clippy::write_literal)]
|
|
|
|
|
|
|
|
use std::io::Write;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut v = Vec::new();
|
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
writeln!(v, "{}", "{hello}");
|
|
|
|
writeln!(v, r"{}", r"{hello}");
|
|
|
|
writeln!(v, "{}", '\'');
|
|
|
|
writeln!(v, "{}", '"');
|
|
|
|
writeln!(v, r"{}", '"'); // don't lint
|
|
|
|
writeln!(v, r"{}", '\'');
|
2021-03-25 13:29:11 -05:00
|
|
|
writeln!(
|
2022-01-27 08:12:45 -06:00
|
|
|
v,
|
2021-03-25 13:29:11 -05:00
|
|
|
"some {}",
|
|
|
|
"hello \
|
|
|
|
world!"
|
|
|
|
);
|
|
|
|
writeln!(
|
2022-01-27 08:12:45 -06:00
|
|
|
v,
|
2021-03-25 13:29:11 -05:00
|
|
|
"some {}\
|
|
|
|
{} \\ {}",
|
|
|
|
"1", "2", "3",
|
|
|
|
);
|
|
|
|
}
|