mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
28 lines
855 B
Rust
28 lines
855 B
Rust
use crate::comments::Comments;
|
|
use crate::expression::parentheses::{
|
|
default_expression_needs_parentheses, NeedsParentheses, Parentheses, Parenthesize,
|
|
};
|
|
use crate::{not_yet_implemented, FormatNodeRule, PyFormatter};
|
|
use ruff_formatter::{write, Buffer, FormatResult};
|
|
use rustpython_parser::ast::ExprStarred;
|
|
|
|
#[derive(Default)]
|
|
pub struct FormatExprStarred;
|
|
|
|
impl FormatNodeRule<ExprStarred> for FormatExprStarred {
|
|
fn fmt_fields(&self, item: &ExprStarred, f: &mut PyFormatter) -> FormatResult<()> {
|
|
write!(f, [not_yet_implemented(item)])
|
|
}
|
|
}
|
|
|
|
impl NeedsParentheses for ExprStarred {
|
|
fn needs_parentheses(
|
|
&self,
|
|
parenthesize: Parenthesize,
|
|
source: &str,
|
|
comments: &Comments,
|
|
) -> Parentheses {
|
|
default_expression_needs_parentheses(self.into(), parenthesize, source, comments)
|
|
}
|
|
}
|