From 22a6e8810bda60a7e5b10be4aa9a78db2ebd19a9 Mon Sep 17 00:00:00 2001 From: Cedric Stephan Date: Thu, 9 Jul 2026 13:50:46 +0200 Subject: [PATCH] fix: silence clippy::map_unwrap_or in rules_overhead dedup cargo clippy --all-features -- -D warnings failed on rules_overhead.rs:143 (map(..).unwrap_or_else(..) on a Result). Use map_or_else, which clippy's own suggestion recommends. Behaviour unchanged: canonicalize the path, else fall back to the original. Fixes the red Clippy / Embed SDK jobs on main. --- rust/src/core/rules_overhead.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/src/core/rules_overhead.rs b/rust/src/core/rules_overhead.rs index 9ff62fb587..eab98b9e6d 100644 --- a/rust/src/core/rules_overhead.rs +++ b/rust/src/core/rules_overhead.rs @@ -141,8 +141,7 @@ pub fn collect_rules_files(home: &Path, project: &Path) -> Vec { let mut seen = std::collections::HashSet::new(); out.retain(|f| { let canonical = std::fs::canonicalize(&f.path) - .map(|p| p.to_string_lossy().to_string()) - .unwrap_or_else(|_| f.path.clone()); + .map_or_else(|_| f.path.clone(), |p| p.to_string_lossy().to_string()); seen.insert(canonical) });