Skip to content

Commit 4cac752

Browse files
committed
review: trim code comments
1 parent 36e51a5 commit 4cac752

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src/generation/generate.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7912,10 +7912,7 @@ fn gen_separated_values<'a>(opts: GenSeparatedValuesParams<'a>, context: &mut Co
79127912
gen_separated_values_with_result(opts, context).items
79137913
}
79147914

7915-
/// True when the value is an arrow / function expression (possibly wrapped in
7916-
/// ExprOrSpread / ParenExpr). These are the prettier-style "last arg hugging"
7917-
/// candidates that should keep inline-multi-line privileges even when there are
7918-
/// other siblings that could also expand inline.
7915+
/// Arrow / function expression (possibly wrapped) — kept inline-multi-line even with other siblings.
79197916
fn is_function_hugging_candidate(value: &NodeOrSeparator) -> bool {
79207917
fn is_arrow_or_fn(expr: Expr) -> bool {
79217918
match expr {
@@ -7958,12 +7955,8 @@ fn gen_separated_values_with_result<'a>(opts: GenSeparatedValuesParams<'a>, cont
79587955
_ => false,
79597956
})
79607957
.collect();
7961-
// Count siblings that would compete for an inline-multi-line slot, but
7962-
// ignore arrow/function-expression last-arg "hugging" candidates — those
7963-
// are the canonical `Array.from(x, () => { ... })` / `foo(arg, () => {})`
7964-
// shape that prettier keeps single-line at the call level. Without this
7965-
// exclusion the array-of-objects fix from issue #641 would regress the
7966-
// last-arrow-arg case.
7958+
// If 2+ non-arrow siblings would each take the inline-multi-line slot,
7959+
// break the container instead of expanding only one (issue #641).
79677960
let inline_multi_line_count = nodes
79687961
.iter()
79697962
.zip(inline_multi_line_flags.iter())

0 commit comments

Comments
 (0)