Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Oct 5, 2023
1 parent e72db70 commit 68cf4ad
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/passes/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit 68cf4ad

Please sign in to comment.