mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
Introduce parenthesized
helper (#5565)
This commit is contained in:
parent
bf4b96c5de
commit
40ddc1604c
7 changed files with 60 additions and 64 deletions
|
@ -10,6 +10,7 @@ use crate::comments::{
|
|||
CommentLinePosition, SourceComment,
|
||||
};
|
||||
use crate::context::NodeLevel;
|
||||
use crate::expression::parentheses::parenthesized;
|
||||
use crate::prelude::*;
|
||||
use crate::trivia::{first_non_trivia_token, SimpleTokenizer, Token, TokenKind};
|
||||
use crate::FormatNodeRule;
|
||||
|
@ -179,14 +180,7 @@ impl FormatNodeRule<Arguments> for FormatArguments {
|
|||
]
|
||||
)?;
|
||||
} else {
|
||||
write!(
|
||||
f,
|
||||
[group(&format_args!(
|
||||
text("("),
|
||||
soft_block_indent(&group(&format_inner)),
|
||||
text(")")
|
||||
))]
|
||||
)?;
|
||||
parenthesized("(", &group(&format_inner), ")").fmt(f)?;
|
||||
}
|
||||
|
||||
f.context_mut().set_node_level(saved_level);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue