Move ExprCall's NeedsParentheses impl into expr_call.rs (#6309)
Accidental move.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
use ruff_python_ast::ExprCall;
|
||||
|
||||
use crate::expression::parentheses::{NeedsParentheses, OptionalParentheses};
|
||||
use crate::prelude::*;
|
||||
use crate::FormatNodeRule;
|
||||
|
||||
@@ -18,3 +20,13 @@ impl FormatNodeRule<ExprCall> for FormatExprCall {
|
||||
write!(f, [func.format(), arguments.format()])
|
||||
}
|
||||
}
|
||||
|
||||
impl NeedsParentheses for ExprCall {
|
||||
fn needs_parentheses(
|
||||
&self,
|
||||
_parent: AnyNodeRef,
|
||||
context: &PyFormatContext,
|
||||
) -> OptionalParentheses {
|
||||
self.func.needs_parentheses(self.into(), context)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user