From f001015c4da9e4ef7640d79301ea528f7055c014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Fri, 2 Aug 2024 13:22:28 +0200 Subject: [PATCH] clippy --- src/input/triangulation.rs | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/input/triangulation.rs b/src/input/triangulation.rs index 5fc6c74..3da8b36 100644 --- a/src/input/triangulation.rs +++ b/src/input/triangulation.rs @@ -192,26 +192,20 @@ impl Triangulation { polygon.edges_index().for_each(|[p0, p1]| { if !added_edges.insert((p0, p1)) || !added_edges.insert((p1, p0)) { } else { - let p0 = added_vertices - .entry(p0) - .or_insert_with(|| { - cdt.insert(Point2 { - x: base_layer.vertices[p0 as usize].coords.x as f64, - y: base_layer.vertices[p0 as usize].coords.y as f64, - }) - .unwrap() + let p0 = *added_vertices.entry(p0).or_insert_with(|| { + cdt.insert(Point2 { + x: base_layer.vertices[p0 as usize].coords.x as f64, + y: base_layer.vertices[p0 as usize].coords.y as f64, }) - .clone(); - let p1 = added_vertices - .entry(p1) - .or_insert_with(|| { - cdt.insert(Point2 { - x: base_layer.vertices[p1 as usize].coords.x as f64, - y: base_layer.vertices[p1 as usize].coords.y as f64, - }) - .unwrap() + .unwrap() + }); + let p1 = *added_vertices.entry(p1).or_insert_with(|| { + cdt.insert(Point2 { + x: base_layer.vertices[p1 as usize].coords.x as f64, + y: base_layer.vertices[p1 as usize].coords.y as f64, }) - .clone(); + .unwrap() + }); cdt.add_constraint_and_split(p0, p1, |v| v); } });