Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

sheet: clippy (items after tests)

bherbruck3b88585e5cf6
diff --git a/crates/doc/src/sheet.rs b/crates/doc/src/sheet.rs
index 09568cc286..9c133351a1 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<String> {
+ 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<String> {
- 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()
-}