We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b019fa3 commit cf69e01Copy full SHA for cf69e01
src/hugr/rewrite/consts.rs
@@ -45,11 +45,12 @@ impl Rewrite for RemoveConstIgnore {
45
if (!h.contains_node(node)) || (!h.get_optype(node).is_load_constant()) {
46
return Err(RemoveError::InvalidNode(node));
47
}
48
-
49
- if h.out_value_types(node)
50
- .next()
51
- .is_some_and(|(p, _)| h.linked_inputs(node, p).next().is_some())
52
- {
+ let (p, _) = h
+ .out_value_types(node)
+ .exactly_one()
+ .ok()
+ .expect("LoadConstant has only one output.");
53
+ if h.linked_inputs(node, p).next().is_some() {
54
return Err(RemoveError::ValueUsed(node));
55
56
0 commit comments