Closed
Description
As long as format!()
treats \
as an escape character, it should handle all the same escapes that normal string literals do. This way a raw string literal can be passed to format!()
and still use the expected escapes. Right now, attempting to do so:
println!(r#"this is a "string": {}\n"#, "example code");
throws a compiler error:
error: invalid escape character `n`
println!(r#"this is a "string": {}\n"#, "example code");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~