chore: resolve SonarCloud maintainability issues (#9044)

* chore: resolve SonarCloud maintainability issues

* fix: format imports and fix effect_entry argument type

* fix: restore test closure and wildcard import that broke compilation

* refactor: split composite_to_surface to reduce cognitive complexity
This commit is contained in:
Dylan M. Taylor
2026-10-25 19:38:31 -04:00
committed by GitHub
parent 718950cab6
commit 3877bb1dbe
17 changed files with 238 additions and 194 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
//! `--update-manifest` rewrites the manifest from the download (after moving a pin).
//! Local mode copies from a working clone instead of downloading (see `fetch_local`).
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
use std::process::Command;
@@ -117,7 +118,7 @@ impl PinnedCorpus {
}
if ft.is_dir() {
self.collect_inner(&p, base, out, visited, dirs);
} else if ft.is_file() && p.extension().and_then(|e| e.to_str()).is_some_and(|e| self.exts.iter().any(|x| e.eq_ignore_ascii_case(x))) {
} else if ft.is_file() && p.extension().and_then(OsStr::to_str).is_some_and(|e| self.exts.iter().any(|x| e.eq_ignore_ascii_case(x))) {
out.push(p.strip_prefix(base).unwrap_or(&p).to_path_buf());
}
}