From 3b88585e5cf6278f31f3cad6b63081b46de31c77 Mon Sep 17 00:00:00 2001 From: bherbruck Date: Thu, 8 Oct 2026 12:51:48 +0000 Subject: [PATCH] sheet: clippy (items after tests) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL --- crates/doc/src/sheet.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/doc/src/sheet.rs b/crates/doc/src/sheet.rs index 09568cc2..9c133351 100644 --- a/crates/doc/src/sheet.rs +++ b/crates/doc/src/sheet.rs @@ -1404,6 +1404,20 @@ pub fn contour_flange(body: &str, rule: &str, rv: &RuleValues, plane: &Plane, pt Ok(sheet) } +/// Persistent names of the sheet edges nearest each world point (empty when none). +pub fn sheet_edge_names(st: &crate::ModelState, pts: &[Vec3]) -> Vec { + pts.iter() + .map(|p| { + st.sheets + .iter() + .filter_map(|sh| sh.edge_at(*p).map(|e| (e.4, sh))) + .min_by(|a, b| a.0.total_cmp(&b.0)) + .and_then(|(_, sh)| sh.edge_name(*p)) + .unwrap_or_default() + }) + .collect() +} + #[cfg(test)] mod tests { use super::*; @@ -1496,17 +1510,3 @@ mod tests { assert!(s.solid().is_ok()); } } - -/// Persistent names of the sheet edges nearest each world point (empty when none). -pub fn sheet_edge_names(st: &crate::ModelState, pts: &[Vec3]) -> Vec { - pts.iter() - .map(|p| { - st.sheets - .iter() - .filter_map(|sh| sh.edge_at(*p).map(|e| (e.4, sh))) - .min_by(|a, b| a.0.total_cmp(&b.0)) - .and_then(|(_, sh)| sh.edge_name(*p)) - .unwrap_or_default() - }) - .collect() -}