mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +00:00
s/ends_in_newline/ends_with_newline/g
This commit is contained in:
parent
aa7822d5cd
commit
434bcd08fd
1 changed files with 4 additions and 4 deletions
|
@ -46,16 +46,16 @@ pub fn fmt_collection<'a, 'buf, T: ExtractSpaces<'a> + Formattable>(
|
|||
let is_only_newlines = item.before.iter().all(|s| s.is_newline());
|
||||
|
||||
if item.before.is_empty() || is_only_newlines {
|
||||
buf.ensure_ends_in_newline();
|
||||
buf.ensure_ends_with_newline();
|
||||
} else {
|
||||
if is_first_item {
|
||||
// The first item in a multiline collection always begins with exactly
|
||||
// one newline (so the delimiter is at the end of its own line),
|
||||
// and that newline appears before the first comment (if there is one).
|
||||
buf.ensure_ends_in_newline();
|
||||
buf.ensure_ends_with_newline();
|
||||
} else {
|
||||
if item.before.starts_with(&[CommentOrNewline::Newline]) {
|
||||
buf.ensure_ends_in_newline();
|
||||
buf.ensure_ends_with_newline();
|
||||
}
|
||||
|
||||
if item
|
||||
|
@ -113,7 +113,7 @@ pub fn fmt_collection<'a, 'buf, T: ExtractSpaces<'a> + Formattable>(
|
|||
item_indent,
|
||||
);
|
||||
|
||||
buf.ensure_ends_in_newline();
|
||||
buf.ensure_ends_with_newline();
|
||||
buf.indent(braces_indent);
|
||||
} else {
|
||||
// is_multiline == false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue