Skip to content

Commit

Permalink
use expect
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Feb 5, 2025
1 parent a2bd930 commit eeb5257
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/view/subgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,9 @@ impl<G: LinkMut> Subgraph<G> {
}
let offset = self.graph.port_offset(other_p).unwrap();
let new_other_p = self.graph.port_index(*new_other, offset).unwrap();
// The edge is a copy of a valid edge so any failure here is a bug in portgraph.
self.graph.link_ports(new_node_p, new_other_p).unwrap();
self.graph
.link_ports(new_node_p, new_other_p)
.expect("Copying known-good edge");
}
None => {
// Boundary edge. Keep same external endpoint
Expand All @@ -378,7 +379,7 @@ impl<G: LinkMut> Subgraph<G> {
internal: node_p.into(),
});
}
Err(e) => panic!("Unexpected error adding boundary edge {}", e),
Err(e) => panic!("Unexpected error copying boundary edge: {}", e),
Ok(_) => (),
}
}
Expand Down

0 comments on commit eeb5257

Please sign in to comment.