From 5fe0fdd0a877b05846595459c822c7c73c1adab2 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Thu, 25 Jan 2024 15:41:13 +0100 Subject: [PATCH] Delete `is_node_with_body` method (#9643) --- crates/ruff_python_ast/src/node.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/crates/ruff_python_ast/src/node.rs b/crates/ruff_python_ast/src/node.rs index 35a536004c..a2b534aba4 100644 --- a/crates/ruff_python_ast/src/node.rs +++ b/crates/ruff_python_ast/src/node.rs @@ -5968,22 +5968,6 @@ impl<'a> AnyNodeRef<'a> { } } - pub const fn is_node_with_body(self) -> bool { - matches!( - self, - AnyNodeRef::StmtIf(_) - | AnyNodeRef::StmtFor(_) - | AnyNodeRef::StmtWhile(_) - | AnyNodeRef::StmtWith(_) - | AnyNodeRef::StmtMatch(_) - | AnyNodeRef::StmtFunctionDef(_) - | AnyNodeRef::StmtClassDef(_) - | AnyNodeRef::StmtTry(_) - | AnyNodeRef::ExceptHandlerExceptHandler(_) - | AnyNodeRef::ElifElseClause(_) - ) - } - /// In our AST, only some alternative branches are represented as a node. This has historical /// reasons, e.g. we added a node for elif/else in if statements which was not originally /// present in the parser.