From ec96612388e727ad6fead6fc833e09a3b66dcf73 Mon Sep 17 00:00:00 2001 From: Sebastian <106036+schoeller@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:30:54 +0200 Subject: [PATCH] fix: resolve the two clippy approx_constant denies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The informational clippy job fails on two pre-existing literals (also failing on main, surfaced on this PR's merge): the trim tangency test's angle list used 3.14 where pi was meant — use the constant; the point-cloud light-direction fixture in render.rs uses a hand-tuned 0.318 component that only looks like 1/pi — keep the tuned value and allow the lint on that statement. --- src/modules/draw/modify/trim.rs | 2 +- src/scene/view/render.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/draw/modify/trim.rs b/src/modules/draw/modify/trim.rs index 4d9946289..5edd637e5 100644 --- a/src/modules/draw/modify/trim.rs +++ b/src/modules/draw/modify/trim.rs @@ -4707,7 +4707,7 @@ mod tests { ); // 1. External tangency: Test across multiple angles and slight epsilons - for angle in [0.0f64, 0.5, 1.0, 1.57, 2.5, 3.14, 4.0, 5.0] { + for angle in [0.0f64, 0.5, 1.0, 1.57, 2.5, std::f64::consts::PI, 4.0, 5.0] { for eps in [-1e-8, 0.0, 1e-8] { let dist = 20.0 + eps; let dx = dist * angle.cos(); diff --git a/src/scene/view/render.rs b/src/scene/view/render.rs index 006285c08..c91d30ae2 100644 --- a/src/scene/view/render.rs +++ b/src/scene/view/render.rs @@ -4823,6 +4823,9 @@ impl Scene { let view = |x: f32, y: f32, z: f32| { (inst.camera.rotation * glam::Vec3::new(x, y, z)).normalize_or(glam::Vec3::Z) }; + // Hand-tuned light-direction fixture: the `0.318` component only + // looks like 1/π, so keep the tuned value verbatim. + #[allow(clippy::approx_constant)] let (first, second) = if source > 0.5 { (view(-0.034, 0.987, 0.158), glam::Vec3::ZERO) } else {