Implement iter(), len() and is_empty() for all display-literal AST nodes (#12807)

This commit is contained in:
Alex Waygood
2024-08-12 11:39:28 +01:00
committed by GitHub
parent a99a45868c
commit aa0db338d9
56 changed files with 304 additions and 240 deletions

View File

@@ -193,7 +193,7 @@ impl FormatNodeRule<ExprTuple> for FormatExprTuple {
TupleParentheses::NeverPreserve => {
optional_parentheses(&ExprSequence::new(item)).fmt(f)
}
TupleParentheses::OptionalParentheses if item.elts.len() == 2 => {
TupleParentheses::OptionalParentheses if item.len() == 2 => {
optional_parentheses(&ExprSequence::new(item)).fmt(f)
}
TupleParentheses::Default | TupleParentheses::OptionalParentheses => {