Enable tupleassign test (#3080)

This commit is contained in:
Charlie Marsh 2023-02-20 19:42:23 -05:00 committed by GitHub
parent b701cca779
commit 90c04b9cff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View file

@ -134,6 +134,8 @@ fn format_tuple(
.trivia
.iter()
.any(|c| matches!(c.kind, TriviaKind::MagicTrailingComma));
let is_unbroken =
expr.location.row() == expr.end_location.unwrap().row();
if magic_trailing_comma {
write!(f, [expand_parent()])?;
}
@ -143,7 +145,7 @@ fn format_tuple(
write!(f, [text(",")])?;
write!(f, [soft_line_break_or_space()])?;
} else {
if magic_trailing_comma {
if magic_trailing_comma || is_unbroken {
write!(f, [if_group_breaks(&text(","))])?;
}
}
@ -156,6 +158,7 @@ fn format_tuple(
.trivia
.iter()
.any(|c| matches!(c.kind, TriviaKind::MagicTrailingComma));
let is_unbroken = expr.location.row() == expr.end_location.unwrap().row();
if magic_trailing_comma {
write!(f, [expand_parent()])?;
}
@ -165,7 +168,7 @@ fn format_tuple(
write!(f, [text(",")])?;
write!(f, [soft_line_break_or_space()])?;
} else {
if magic_trailing_comma {
if magic_trailing_comma || is_unbroken {
write!(f, [if_group_breaks(&text(","))])?;
}
}