From dd2c6e4f9e319ca58766cfc431e32c4709d3d500 Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Wed, 27 Nov 2024 14:10:16 +0000 Subject: [PATCH] Revert change that allowed removing the root; panic if such is attempted --- hugr-core/src/hugr/hugrmut.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hugr-core/src/hugr/hugrmut.rs b/hugr-core/src/hugr/hugrmut.rs index 409661e7d..3d9edc050 100644 --- a/hugr-core/src/hugr/hugrmut.rs +++ b/hugr-core/src/hugr/hugrmut.rs @@ -124,10 +124,10 @@ pub trait HugrMut: HugrMutInternals { /// /// # Panics /// - /// If the node is not in the graph. + /// If the node is not in the graph, or if the node is the root node. #[inline] fn remove_node(&mut self, node: Node) -> OpType { - panic_invalid_node(self, node); + panic_invalid_non_root(self, node); self.hugr_mut().remove_node(node) }