Apply more suggestions.

This commit is contained in:
Tom Alexander
2023-10-16 17:03:16 -04:00
parent 4ba0e3611b
commit 2dd5246506
9 changed files with 28 additions and 38 deletions

View File

@@ -120,15 +120,13 @@ pub(crate) fn coalesce_whitespace_if_line_break(input: &str) -> Cow<'_, str> {
ret.push(c);
}
// Do nothing if preceding character was whitespace and this character also is whitespace.
} else if c.is_ascii_whitespace() {
// Preceding character was not whitespace but this is.
sub_loop_in_whitespace = true;
ret.push(' ');
} else {
if c.is_ascii_whitespace() {
// Preceding character was not whitespace but this is.
sub_loop_in_whitespace = true;
ret.push(' ');
} else {
// Preceding character was not whitespace and this is not either.
ret.push(c);
}
// Preceding character was not whitespace and this is not either.
ret.push(c);
}
}
if !*in_whitespace {