s/ends_in_newline/ends_with_newline/g

This commit is contained in:
Richard Feldman 2022-07-11 13:15:22 -04:00
parent aa7822d5cd
commit 434bcd08fd
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -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