From 4a111f9b58c933f2828fd227a5d13be3e6d6a2b4 Mon Sep 17 00:00:00 2001 From: Rendo Date: Mon, 10 Nov 2025 08:37:56 +0500 Subject: [PATCH] insert doesn't need to have children count check --- src/node/node_modifier/mod.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/node/node_modifier/mod.rs b/src/node/node_modifier/mod.rs index dba5d2f..596ed1d 100644 --- a/src/node/node_modifier/mod.rs +++ b/src/node/node_modifier/mod.rs @@ -146,17 +146,7 @@ impl<'a> NodeModifier<'a> { mut node: Node, between: Option, ) -> Result<(), NodeManipulationError> { - if let Some(x) = self.picked_node.max_children_count { - if self.picked_node.children.len() + 1 > x { - return Err(NodeManipulationError::TooMuchChildren(node)); - } - } let children_count = self.picked_node.children.len(); - if let NodeHandler::Empty = &self.picked_node.handler - && children_count - 1 > 0 - { - return Err(NodeManipulationError::TooMuchChildren(node)); - } if children_count <= 0 { return Err(NodeManipulationError::NotEnoughChildren); }