Don't swallow trailing whitespace

This commit is contained in:
Zsolt Dollenstein 2023-07-17 21:06:40 +01:00
parent 07a168b6e4
commit ef1801ac80
No known key found for this signature in database
GPG key ID: 7201415EA794C33E
2 changed files with 7 additions and 6 deletions

View file

@ -77,12 +77,8 @@ impl<'r, 'a> Inflate<'a> for DeflatedModule<'r, 'a> {
}
}
if let Some(num) = last_indented {
if num + 1 == footer.len() {
footer = vec![];
} else {
let (_, rest) = footer.split_at(num + 1);
footer = rest.to_vec();
}
let (_, rest) = footer.split_at(num);
footer = rest.to_vec();
}
} else {
swap(&mut header, &mut footer);

View file

@ -0,0 +1,5 @@
x = 42
print(x)