From 4126ae5a759b03e9067983c99a4cb8932321b30d Mon Sep 17 00:00:00 2001 From: bherbruck Date: Thu, 8 Oct 2026 08:29:56 +0000 Subject: [PATCH] Clippy: assign operators in the path sweep, isocurve grid and centre of mass Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL --- crates/doc/src/project3d.rs | 4 ++-- crates/engine/src/cmd/sketch_inspect.rs | 2 +- crates/kernel/src/sweep_path.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/doc/src/project3d.rs b/crates/doc/src/project3d.rs index 2541252d..4a5b24ff 100644 --- a/crates/doc/src/project3d.rs +++ b/crates/doc/src/project3d.rs @@ -363,12 +363,12 @@ pub fn iso_grid(m: &Mesh, f: u32, p: Vec3, count: usize) -> Vec> { for dir in ["u", "v"] { // The family's cutting direction, from the curve through p. let Some(first) = iso_curve(m, f, p, dir).into_iter().next() else { continue }; - let pts: Vec = first.iter().copied().collect(); + let pts: Vec = first.to_vec(); // Normal of the plane that curve lies in. let Some(c) = pts.first().copied() else { continue }; let mut n = Vec3::ZERO; for w in pts.windows(2) { - n = n + (w[0] - c).cross(w[1] - c); + n += (w[0] - c).cross(w[1] - c); } let cut_n = match n.normalized() { Some(n) => n, diff --git a/crates/engine/src/cmd/sketch_inspect.rs b/crates/engine/src/cmd/sketch_inspect.rs index 53599d6b..def5c9c5 100644 --- a/crates/engine/src/cmd/sketch_inspect.rs +++ b/crates/engine/src/cmd/sketch_inspect.rs @@ -313,7 +313,7 @@ fn center_of_mass(s: &mut Session, p: &Value) -> Result { continue; } vol += m.volume; - moment = moment + m.centroid * m.volume; + moment += m.centroid * m.volume; out.push(json!({"body": b.name, "center": [m.centroid.x, m.centroid.y, m.centroid.z], "volume": m.volume})); } if out.is_empty() { diff --git a/crates/kernel/src/sweep_path.rs b/crates/kernel/src/sweep_path.rs index f1b37ae8..60c82097 100644 --- a/crates/kernel/src/sweep_path.rs +++ b/crates/kernel/src/sweep_path.rs @@ -117,7 +117,7 @@ fn stations(pts: &[Vec3], tangents: &[Vec3], mitre: &[Option<(Vec3, f64)>]) -> R let mut m = [col(Vec3::X), col(Vec3::Y), col(Vec3::Z)]; if let Some(Some((b, s))) = mitre.get(i) { for c in &mut m { - *c = *c + *b * ((s - 1.0) * c.dot(*b)); + *c += *b * ((s - 1.0) * c.dot(*b)); } } out.push(Station { at: *pts.get(i).ok_or_else(|| KernelError::Invalid("sweep path".into()))?, m });