Skip to content

Commit

Permalink
Revert change that allowed removing the root; panic if such is attempted
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Nov 27, 2024
1 parent fa295e8 commit dd2c6e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hugr-core/src/hugr/hugrmut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit dd2c6e4

Please sign in to comment.