Skip to content

Commit

Permalink
simple_replace.rs: use HugrMut::remove_node, includes clearing op_typ…
Browse files Browse the repository at this point in the history
…es (#242)
  • Loading branch information
acl-cqc committed Jul 4, 2023
1 parent 29e869d commit 17c24e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hugr/rewrite/simple_replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::collections::{HashMap, HashSet};

use itertools::Itertools;
use portgraph::{LinkMut, LinkView, MultiMut, NodeIndex, PortMut, PortView};
use portgraph::{LinkMut, LinkView, MultiMut, NodeIndex, PortView};

use crate::hugr::{HugrMut, HugrView};
use crate::{
Expand Down Expand Up @@ -227,8 +227,7 @@ impl Rewrite for SimpleReplacement {
}
// 3.5. Remove all nodes in self.removal and edges between them.
for node in &self.removal {
h.graph.remove_node(node.index);
h.hierarchy.remove(node.index);
h.remove_node(*node).unwrap();
}
Ok(())
}
Expand Down

0 comments on commit 17c24e3

Please sign in to comment.