Skip to content

Commit

Permalink
yaml/updater: Always emit trailing newline (fixes #298)
Browse files Browse the repository at this point in the history
Signed-off-by: Ikey Doherty <ikey@serpentos.com>
  • Loading branch information
ikeycode committed Nov 8, 2024
1 parent 7fa122b commit a344a80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/yaml/src/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ impl Updater {
}

pub fn apply(&self, input: impl ToString) -> String {
self.operations
let mut output = self
.operations
.iter()
.fold(input.to_string(), |input, operation| operation.apply(&input))
.fold(input.to_string(), |input, operation| operation.apply(&input));
if !output.ends_with('\n') {
output.push('\n');
}
output
}
}

Expand Down

0 comments on commit a344a80

Please sign in to comment.