From 68cf4ad73b8ea99f23c0a94dc65e8e98d9eef69d Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Thu, 5 Oct 2023 12:19:44 +0100 Subject: [PATCH] Review comments --- src/passes/chunks.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/passes/chunks.rs b/src/passes/chunks.rs index c01889fd..82148170 100644 --- a/src/passes/chunks.rs +++ b/src/passes/chunks.rs @@ -99,8 +99,6 @@ impl Chunk { } /// Insert the chunk back into a circuit. - // - // TODO: The new chunk may have input ports directly connected to outputs. We have to take care of those. pub(self) fn insert(&self, circ: &mut impl HugrMut, root: Node) -> ChunkInsertResult { let [chunk_inp, chunk_out] = self.circ.get_io(self.circ.root()).unwrap(); @@ -178,22 +176,16 @@ struct ChunkInsertResult { } /// The target of a chunk connection in a reassembled circuit. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, From)] enum ConnectionTarget { /// The target is a single node and port. + #[from] InsertedNode(Node, Port), /// The link goes directly to the opposite boundary, without an intermediary /// node. - #[allow(unused)] TransitiveConnection(ChunkConnection), } -impl From<(Node, Port)> for ConnectionTarget { - fn from((node, port): (Node, Port)) -> Self { - Self::InsertedNode(node, port) - } -} - /// An utility for splitting a circuit into chunks, and reassembling them /// afterwards. ///