diff --git a/crates/fj-kernel/src/algorithms/approx/cycles.rs b/crates/fj-kernel/src/algorithms/approx/cycles.rs index 92beb23e0..5a43a4e01 100644 --- a/crates/fj-kernel/src/algorithms/approx/cycles.rs +++ b/crates/fj-kernel/src/algorithms/approx/cycles.rs @@ -22,7 +22,7 @@ impl CycleApprox { for edge in &cycle.edges { let mut edge_points = Vec::new(); approx_curve(&edge.curve(), tolerance, &mut edge_points); - approx_edge(edge.vertices.clone(), &mut edge_points); + approx_edge(edge.vertices, &mut edge_points); points.extend(edge_points.into_iter().map(|point| { let local = diff --git a/crates/fj-kernel/src/algorithms/reverse.rs b/crates/fj-kernel/src/algorithms/reverse.rs index e06d9eeff..6f737224b 100644 --- a/crates/fj-kernel/src/algorithms/reverse.rs +++ b/crates/fj-kernel/src/algorithms/reverse.rs @@ -51,9 +51,11 @@ fn reverse_local_coordinates_in_cycle( Local::new(local, edge.curve.global()) }; - let vertices = edge.vertices.clone(); - Edge { curve, vertices } + Edge { + curve, + vertices: edge.vertices, + } }) .collect(); diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index 63373fa2a..ec7b73532 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -152,10 +152,7 @@ fn create_non_continuous_side_face( Vertex::new(Point::from([1.]), b.1), ]); - let edge = Edge { - curve, - vertices: vertices.clone(), - }; + let edge = Edge { curve, vertices }; edges.push(edge); } diff --git a/crates/fj-kernel/src/objects/edge.rs b/crates/fj-kernel/src/objects/edge.rs index 0524c3815..f05832c90 100644 --- a/crates/fj-kernel/src/objects/edge.rs +++ b/crates/fj-kernel/src/objects/edge.rs @@ -104,7 +104,7 @@ impl fmt::Display for Edge { } /// The vertices that bound an edge -#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct VerticesOfEdge(Option<[Vertex; 2]>); impl VerticesOfEdge { diff --git a/crates/fj-operations/src/difference_2d.rs b/crates/fj-operations/src/difference_2d.rs index a65a9e989..a5db4e5b7 100644 --- a/crates/fj-operations/src/difference_2d.rs +++ b/crates/fj-operations/src/difference_2d.rs @@ -109,14 +109,14 @@ fn add_cycle(cycle: Cycle, reverse: bool) -> Cycle { }; let vertices = if reverse { - edge.vertices.clone().reverse() + edge.vertices.reverse() } else { - edge.vertices.clone() + edge.vertices }; let edge = Edge { curve: Local::new(curve_local, curve_canonical), - vertices: vertices.clone(), + vertices, }; edges.push(edge);