From bff1d9a1f87cd01d1462452c9c857d0f3492dcd3 Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Thu, 5 Oct 2023 10:48:37 +0100 Subject: [PATCH] chore: Update hugr dep --- Cargo.toml | 4 ++-- src/circuit.rs | 9 ++++++--- src/portmatching/matcher.rs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 56108aeb3..f198f9af1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ fxhash = "0.2.1" rmp-serde = { version = "1.1.2", optional = true } delegate = "0.10.0" csv = { version = "1.2.2" } -chrono = { version ="0.4.30" } +chrono = { version = "0.4.30" } bytemuck = "1.14.0" stringreader = "0.1.1" crossbeam-channel = "0.5.8" @@ -73,7 +73,7 @@ members = ["pyrs", "compile-rewriter", "taso-optimiser"] [workspace.dependencies] -quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "0ce711b" } +quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "e119a99" } portgraph = { version = "0.9", features = ["serde"] } pyo3 = { version = "0.19" } itertools = { version = "0.11.0" } diff --git a/src/circuit.rs b/src/circuit.rs index 3ae2b8a10..7d00611b9 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -262,7 +262,8 @@ fn update_signature( }; let new_inp_op = Input::new(inp_types.clone()); let inp_exts = circ.get_nodetype(inp).input_extensions().cloned(); - circ.replace_op(inp, NodeType::new(new_inp_op, inp_exts)); + circ.replace_op(inp, NodeType::new(new_inp_op, inp_exts)) + .unwrap(); // Update output node if necessary. let out_types = out_index.map(|out_index| { @@ -277,7 +278,8 @@ fn update_signature( }; let new_out_op = Output::new(out_types.clone()); let inp_exts = circ.get_nodetype(out).input_extensions().cloned(); - circ.replace_op(out, NodeType::new(new_out_op, inp_exts)); + circ.replace_op(out, NodeType::new(new_out_op, inp_exts)) + .unwrap(); out_types }); @@ -291,7 +293,8 @@ fn update_signature( } let new_dfg_op = DFG { signature }; let inp_exts = circ.get_nodetype(circ.root()).input_extensions().cloned(); - circ.replace_op(circ.root(), NodeType::new(new_dfg_op, inp_exts)); + circ.replace_op(circ.root(), NodeType::new(new_dfg_op, inp_exts)) + .unwrap(); } impl Circuit for T where T: HugrView {} diff --git a/src/portmatching/matcher.rs b/src/portmatching/matcher.rs index 2da3fa45e..45eb5d17e 100644 --- a/src/portmatching/matcher.rs +++ b/src/portmatching/matcher.rs @@ -375,7 +375,7 @@ impl From for InvalidPatternMatch { match value { InvalidSubgraph::NotConvex => InvalidPatternMatch::NotConvex, InvalidSubgraph::EmptySubgraph => InvalidPatternMatch::EmptyMatch, - InvalidSubgraph::NoSharedParent | InvalidSubgraph::InvalidBoundary => { + InvalidSubgraph::NoSharedParent | InvalidSubgraph::InvalidBoundary(_) => { InvalidPatternMatch::InvalidSubcircuit } }