From 2c0a98671613a50677bd3f1991dfbd38888f5313 Mon Sep 17 00:00:00 2001 From: Daniel Doerr Date: Tue, 17 Oct 2023 16:58:13 +0200 Subject: [PATCH] fixing bug described in Issue #11, a second time! --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c26f54e..dab60a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -316,7 +316,12 @@ fn collapse( .neighbors(*v, Direction::Right) .filter(|u| !del_subg.edge_deleted(v, u)) .collect(); - for x in outgoing_edges { + for mut x in outgoing_edges { + if &x == v { + x = w; + } else if x == v.flip() { + x = w.flip() + } if !graph.has_edge(w, x) { graph.create_edge(Edge::edge_handle(w, x)); log::debug!("create edge {}{}", v2str(&w), v2str(&x));