Remove unnecessary LibCST usage in key-in-dict (#6727)
## Summary We're using LibCST to ensure that we return the full parenthesized range of an expression, for display purposes. We can just use `parenthesized_range` which is more efficient and removes one LibCST dependency. ## Test Plan `cargo test`
This commit is contained in:
@@ -339,7 +339,9 @@ impl FormatRule<Suite, PyFormatContext<'_>> for FormatSuite {
|
||||
pub(crate) fn contains_only_an_ellipsis(body: &[Stmt], comments: &Comments) -> bool {
|
||||
match body {
|
||||
[Stmt::Expr(ast::StmtExpr { value, .. })] => {
|
||||
let [node] = body else { return false; };
|
||||
let [node] = body else {
|
||||
return false;
|
||||
};
|
||||
matches!(
|
||||
value.as_ref(),
|
||||
Expr::Constant(ast::ExprConstant {
|
||||
|
||||
Reference in New Issue
Block a user