fix(rust): resolve all clippy warnings treated as errors in CI

Fix 18 clippy errors across 7 files:
- lib.rs: change doc comment to regular comment (empty line after doc)
- arch_audit.rs: replace format!() with string literal, use is_none_or
- code_quality.rs: collapsible if, map_or → is_none_or
- commit.rs: collapsible match guard
- explore.rs: needless_range_loop → iterator enumerate
- skills.rs: map_or(false,...) → is_some_and
- semantic_search.rs: map_or → is_none_or, sort_by → sort_by_key,
  remove explicit type to avoid type_complexity

CI was failing with 'error: could not compile zesdex-infrastructure
due to 18 previous errors' at clippy step.
This commit is contained in:
Cyrene (Mem)
2026-07-22 14:16:56 +07:00
parent 958645ed7f
commit 6b90c7eb0d
7 changed files with 48 additions and 50 deletions
@@ -181,7 +181,7 @@ fn scan_file(
if trimmed.starts_with("use ") {
for &forbidden in forbidden {
let pattern = format!("use {forbidden}");
if trimmed.starts_with(&pattern) || trimmed.starts_with(&format!("use crate::")) {
if trimmed.starts_with(&pattern) || trimmed.starts_with("use crate::") {
// `use crate::` in domain could reference domain-only items — skip.
continue;
}
@@ -234,11 +234,11 @@ pub fn audit_layering(root: &Path) -> Result<AuditReport> {
let mut files_scanned = 0;
for entry in Walk::new(&apps_dir).flatten() {
if entry.file_type().map_or(true, |ft| !ft.is_file()) {
if entry.file_type().is_none_or(|ft| !ft.is_file()) {
continue;
}
let path = entry.path();
if path.extension().map_or(true, |e| e != "rs") {
if path.extension().is_none_or(|e| e != "rs") {
continue;
}