preserve multiline string trailing whitespace

This commit is contained in:
Aidan 2024-08-17 09:57:59 -04:00
parent 7be537dd55
commit 1551d8fb0d
No known key found for this signature in database
2 changed files with 9 additions and 2 deletions

View file

@ -627,8 +627,8 @@ fn fmt_str_body(body: &str, buf: &mut Buf) {
'\u{200c}' => buf.push_str("\\u(200c)"),
'\u{feff}' => buf.push_str("\\u(feff)"),
// Don't change anything else in the string
' ' => buf.spaces(1),
'\n' => buf.newline(),
' ' => buf.push_str_allow_spaces(" "),
'\n' => buf.push_str_allow_spaces("\n"),
_ => buf.push(c),
}
}