mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Avoid reallocation when ensuring trailing newline
This commit is contained in:
parent
da5fdf6d2f
commit
8f6f20b57d
2 changed files with 44 additions and 5 deletions
|
@ -181,8 +181,7 @@ fn fmt_all<'a>(arena: &'a Bump, buf: &mut Buf<'a>, ast: &'a Ast) {
|
|||
fmt_def(buf, arena.alloc(def.value), 0);
|
||||
}
|
||||
|
||||
buf.trim_end();
|
||||
buf.newline();
|
||||
buf.fmt_end_of_file();
|
||||
}
|
||||
|
||||
/// RemoveSpaces normalizes the ast to something that we _expect_ to be invariant under formatting.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue