You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~