Skip to content

Commit

Permalink
fix: Simple replace incorrectly copying metadata (#545)
Browse files Browse the repository at this point in the history
The rewrite was incorrectly using the old node id when updating the
metadata in the target hugr.
  • Loading branch information
aborgna-q authored Sep 20, 2023
1 parent ebb2473 commit 981f4f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hugr/rewrite/simple_replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Rewrite for SimpleReplacement {

// Move the metadata
let meta: &NodeMetadata = self.replacement.get_metadata(node);
h.set_metadata(node, meta.clone()).unwrap();
h.set_metadata(new_node, meta.clone()).unwrap();
}
// Add edges between all newly added nodes matching those in replacement.
// TODO This will probably change when implicit copies are implemented.
Expand Down

0 comments on commit 981f4f9

Please sign in to comment.