From c080c8874cecae937b019b6ce087bec91b4fd6da Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Feb 2024 12:05:14 +0100 Subject: [PATCH 1/3] Improve doc comment --- crates/fj-core/src/operations/sweep/face.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/sweep/face.rs b/crates/fj-core/src/operations/sweep/face.rs index bef57f79f..92686f3e9 100644 --- a/crates/fj-core/src/operations/sweep/face.rs +++ b/crates/fj-core/src/operations/sweep/face.rs @@ -15,7 +15,7 @@ use super::{SweepCache, SweepRegion}; /// /// [module documentation]: super pub trait SweepFace { - /// # Sweep the [`Face`] + /// # Sweep the [`Face`] into a [`Shell`] fn sweep_face( &self, path: impl Into>, From b44e7c70ac446d6ded6363db78c7e1bdcf61f839 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Feb 2024 12:07:08 +0100 Subject: [PATCH 2/3] Fix variable name --- crates/fj-core/src/operations/sweep/face.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-core/src/operations/sweep/face.rs b/crates/fj-core/src/operations/sweep/face.rs index 92686f3e9..ac33f810b 100644 --- a/crates/fj-core/src/operations/sweep/face.rs +++ b/crates/fj-core/src/operations/sweep/face.rs @@ -51,12 +51,12 @@ impl SweepFace for Handle { let bottom_face = self.clone(); faces.push(bottom_face.clone()); - let side_faces = bottom_face + let other_faces = bottom_face .region() .sweep_region(bottom_face.surface(), path, cache, core) .all_faces() .map(|side_face| side_face.insert(&mut core.services)); - faces.extend(side_faces); + faces.extend(other_faces); Shell::new(faces) } From 2381840f3525cd9d36a8489123de1b289ee51e84 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Feb 2024 12:09:26 +0100 Subject: [PATCH 3/3] Refactor to avoid mutable variable --- crates/fj-core/src/operations/sweep/region.rs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/fj-core/src/operations/sweep/region.rs b/crates/fj-core/src/operations/sweep/region.rs index 700d9deb1..bc54c7148 100644 --- a/crates/fj-core/src/operations/sweep/region.rs +++ b/crates/fj-core/src/operations/sweep/region.rs @@ -60,21 +60,21 @@ impl SweepRegion for Region { core, ); - let mut top_interiors = Vec::new(); - - for bottom_cycle in self.interiors() { - let top_cycle = sweep_cycle( - bottom_cycle, - surface, - self.color(), - &mut faces, - path, - cache, - core, - ); - - top_interiors.push(top_cycle); - } + let top_interiors = self + .interiors() + .iter() + .map(|bottom_cycle| { + sweep_cycle( + bottom_cycle, + surface, + self.color(), + &mut faces, + path, + cache, + core, + ) + }) + .collect::>(); let top_face = { let top_surface = surface