Skip to content

Commit

Permalink
Consolidate redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 23, 2022
1 parent 1e522a2 commit 526610a
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions crates/fj-kernel/src/partial/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,20 @@ impl<'a> PartialHalfEdge<'a> {
};

let vertices = {
// Can be cleaned up, once `zip` is stable:
// https://doc.rust-lang.org/std/primitive.array.html#method.zip
let [a_global, b_global] = global_vertices;
let [a_surface, b_surface] = surface_vertices;

[
Vertex::new(
Point::from([0.]),
curve.clone(),
a_surface,
a_global,
),
Vertex::new(
Point::from([1.]),
curve.clone(),
b_surface,
b_global,
),
]
[(0., a_surface, a_global), (1., b_surface, b_global)].map(
|(position, surface_form, global_form)| {
Vertex::new(
[position],
curve.clone(),
surface_form,
global_form,
)
},
)
};

self.curve = Some(curve);
Expand Down

0 comments on commit 526610a

Please sign in to comment.