Skip to content

Commit 2968bc5

Browse files
authored
feat: Implement Debug for generic Wire<N>s (#2068)
This sightly changes the debug output of `Wire<Node>`, but it shouldn't matter much since this is not the `Display` impl. before: `Wire { node: 42, port: OutgoingPort(2) }` after: `Wire { node: Node(42), port: OutgoingPort(2) }`
1 parent a13b08e commit 2968bc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hugr-core/src/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ impl std::fmt::Debug for OutgoingPort {
301301
}
302302
}
303303

304-
impl std::fmt::Debug for Wire {
304+
impl<N: HugrNode> std::fmt::Debug for Wire<N> {
305305
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
306306
f.debug_struct("Wire")
307-
.field("node", &self.0.index())
307+
.field("node", &self.0)
308308
.field("port", &self.1)
309309
.finish()
310310
}

0 commit comments

Comments
 (0)