mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 10:35:58 +00:00
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.
This commit is contained in:
@@ -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<Self> {
|
||||
if value == 0.0 || !value.is_normal() {
|
||||
return Err(invalid("support arithmetic overflow or underflow"));
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user