diff --git a/lab5/src/gui/graph.rs b/lab5/src/gui/graph.rs index eb1b11c..37e2a51 100644 --- a/lab5/src/gui/graph.rs +++ b/lab5/src/gui/graph.rs @@ -39,10 +39,10 @@ fn draw_ants(ui: &mut Ui, vertex_locations: &mut [(f32, f32)], data: &GeneticSim chromosome.iter().reduce(|a, b| { match data.graph.vertices[*a] .iter() - .position(|e| data.graph.edges[*e].another(*a) == *b) + .find(|e| data.graph.edges[**e].another(*a) == *b) { None => unreachable!(), - Some(e) => usage[e] += 1, + Some(e) => usage[*e] += 1, }; return b; });