Consolidate duplicated code

This commit is contained in:
Hanno Braun 2022-03-08 17:09:23 +01:00
parent 65cf917fe5
commit 2036ef9040

View File

@ -50,10 +50,8 @@ impl ToShape for fj::Difference2d {
{ {
// Can't panic, as we just verified that both shapes have one face. // Can't panic, as we just verified that both shapes have one face.
let (a, b) = ( let [a, b] = [&mut a, &mut b]
a.faces().all().next().unwrap(), .map(|shape| shape.faces().all().next().unwrap());
b.faces().all().next().unwrap(),
);
let (a, b, surface_a, surface_b) = let (a, b, surface_a, surface_b) =
match ((*a).clone(), (*b).clone()) { match ((*a).clone(), (*b).clone()) {