diff --git a/crates/geom/src/brep/normal_section.rs b/crates/geom/src/brep/normal_section.rs index c9221bcca..e41035fe8 100644 --- a/crates/geom/src/brep/normal_section.rs +++ b/crates/geom/src/brep/normal_section.rs @@ -82,7 +82,7 @@ fn nonlinear(d: &Partials, du: &Series, dv: &Series) -> Series { let term = times(&pu[i], &pv[j]); let weight = 1.0 / (factorial(i) * factorial(j)); for (o, t) in out.iter_mut().zip(term) { - *o = *o + d[i][j] * (t * weight); + *o += d[i][j] * (t * weight); } } out diff --git a/crates/geom/src/tess/partials.rs b/crates/geom/src/tess/partials.rs index e87fd278a..569ecfd20 100644 --- a/crates/geom/src/tess/partials.rs +++ b/crates/geom/src/tess/partials.rs @@ -134,7 +134,7 @@ fn nurbs_partials(degree: [usize; 2], knots: &[Vec; 2], count: [usize; 2], let l = total - k; let mut x = xyz(a[k][l]); for (i, j) in (0..=k).flat_map(|i| (0..=l).map(move |j| (i, j))).filter(|ij| *ij != (0, 0)) { - x = x - d[k - i][l - j] * (binomial(k, i) * binomial(l, j) * a[i][j][3]); + x -= d[k - i][l - j] * (binomial(k, i) * binomial(l, j) * a[i][j][3]); } d[k][l] = x * (1.0 / w); } @@ -169,7 +169,7 @@ impl EvalCurve { for k in 0..=order { let mut x = xyz(*a.get(k)?); for i in 1..=k { - x = x - *d.get(k - i)? * (binomial(k, i) * a.get(i)?[3]); + x -= *d.get(k - i)? * (binomial(k, i) * a.get(i)?[3]); } d.push(x * (1.0 / w)); } diff --git a/crates/kernel/src/continuity.rs b/crates/kernel/src/continuity.rs index fd8c37bf7..77aaf3752 100644 --- a/crates/kernel/src/continuity.rs +++ b/crates/kernel/src/continuity.rs @@ -429,7 +429,7 @@ fn station(at: Vec3, tangent: Vec3, on_a: &mut FaceSurface, on_b: &mut FaceSurfa // round, so its k-th derivative of curvature reads (−1)^(k+1) times as much in face a's. let opposed = na.dot(nb) < 0.0; let jump = |k: usize, a: f64, b: f64| { - let flip = if opposed && k % 2 == 0 { -1.0 } else { 1.0 }; + let flip = if opposed && k.is_multiple_of(2) { -1.0 } else { 1.0 }; (a - flip * b).abs() }; let [ka, ca, ra] = ja.values(); diff --git a/crates/ui-egui/src/dialogs_surface.rs b/crates/ui-egui/src/dialogs_surface.rs index 55fb78788..b2b75dd13 100644 --- a/crates/ui-egui/src/dialogs_surface.rs +++ b/crates/ui-egui/src/dialogs_surface.rs @@ -1111,7 +1111,7 @@ mod tests { for g in Continuity::ALL { let (label, tip) = (locale.text(g.label_id()), locale.text(g.tip_id())); assert!(label != g.label_id() && tip != g.tip_id(), "{lang}: {g:?} has no text"); - assert!(!coded(&label), "{lang}: the {g:?} label names a code: {label}"); + assert!(!coded(label), "{lang}: the {g:?} label names a code: {label}"); assert!(tip.contains(g.code()), "{lang}: the {g:?} hover text names its code: {tip}"); } }