The Clippy lint for calls to write! ,whose format string ends with a newline (\n), erroneously flags the case where the backslash itself is escaped (\\n). For example, the following Rust code triggers the warning:
use std::io;
use std::io::Write;
fn main() -> std::io::Result<()> {
write!(io::stdout(), "\\n")?;
Ok(())
}
I am using the following version of Clippy:
$ cargo clippy -V
clippy 0.0.212 (2e26fdc 2018-11-22)
Thanks for creating such a great utility!