refactor(rust): misc fixes & tidying

This commit is contained in:
Amaan Qureshi 2024-04-09 21:42:59 -04:00
parent 5825e24d56
commit abc7910381
23 changed files with 137 additions and 127 deletions

View file

@ -753,8 +753,7 @@ fn to_token_vector<'a>(
for (i, l) in s.split('\n').enumerate() {
let l = l.trim_end_matches('\r');
if i > 0 {
lines.push(line);
line = Vec::new();
lines.push(std::mem::take(&mut line));
}
if !l.is_empty() {
line.push((l, highlights.clone()));