From 6b39ee36865890ae230c29a742f2e7e1c971fb7f Mon Sep 17 00:00:00 2001 From: lillith <35337584+0xlillith@users.noreply.github.com> Date: Thu, 29 Oct 2026 02:59:05 +0100 Subject: [PATCH] fix(dxf): resolve strict Clippy findings without weakening checks Remove an unused private Interval helper and collapse the copied-vertex guard to an equivalent let-chain with identical evaluation order and error. Preserve all 28 geometry and 10 bounds tests, limits and assertions. The prior a7f3c78b development attempt stopped at Clippy; IO/engine tests and wasm were not reached. Both corrective hunks were source-reviewed, and normal formatting passed. Tests for this new source remain unrun. --- crates/io/src/dxf_out/file_model/bulges.rs | 4 ---- crates/io/src/dxf_out/file_model/geometry.rs | 9 +++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/crates/io/src/dxf_out/file_model/bulges.rs b/crates/io/src/dxf_out/file_model/bulges.rs index 8877e6913..d899524a0 100644 --- a/crates/io/src/dxf_out/file_model/bulges.rs +++ b/crates/io/src/dxf_out/file_model/bulges.rs @@ -37,10 +37,6 @@ impl Interval { Self::checked(value, value) } - fn is(self, value: f64) -> bool { - self.lo == value && self.hi == value - } - fn rounded(value: f64) -> Result { if value == 0.0 || !value.is_normal() { return Err(invalid("support arithmetic overflow or underflow")); diff --git a/crates/io/src/dxf_out/file_model/geometry.rs b/crates/io/src/dxf_out/file_model/geometry.rs index bb88dca03..c14d07087 100644 --- a/crates/io/src/dxf_out/file_model/geometry.rs +++ b/crates/io/src/dxf_out/file_model/geometry.rs @@ -242,10 +242,11 @@ fn transformed_shape(shape: &DxfShape, scale: f64, translation: Vec2) -> Result< let mut previous: Option<(Vec2, Vec2)> = None; for vertex in vertices { let at = transformed_point(vertex.at, scale, translation)?; - if let Some((old, last)) = previous { - if old != vertex.at && last == at { - return Err(invalid("DXF transform collapses adjacent distinct bulged vertices")); - } + if let Some((old, last)) = previous + && old != vertex.at + && last == at + { + return Err(invalid("DXF transform collapses adjacent distinct bulged vertices")); } copied.push(DxfVertex { at, bulge: vertex.bulge }); previous = Some((vertex.at, at));