refactor: fix last 4 clippy warnings (if_same_then_else, too_many_arguments)

Reduced warnings from 4 to 0 — cookbook lib is now clippy-clean.

Changes:
- if_same_then_else (1): combined identical Ok(list) branches with || in
  staged_pkg.rs new_recursive()
- too_many_arguments (3): added #[allow(clippy::too_many_arguments)] with
  justification comments (required by AGENTS.md WARNING POLICY) on
  display_tree_entry, walk_tree_entry, new_recursive — params are genuinely
  independent display/traversal/recursion options

Verification: cargo check , cargo test --lib  38/38, cargo clippy 0 warnings.
This commit is contained in:
2026-07-18 18:08:14 +09:00
parent 67de313411
commit e1bfeacba0
3 changed files with 4 additions and 3 deletions
+2
View File
@@ -16,6 +16,7 @@ pub enum WalkTreeEntry<'a> {
Missing,
}
#[allow(clippy::too_many_arguments)] // params are independent display options
pub fn display_tree_entry(
package_name: &PackageName,
recipe_map: &HashMap<&PackageName, &CookRecipe>,
@@ -39,6 +40,7 @@ pub fn display_tree_entry(
)
}
#[allow(clippy::too_many_arguments)] // params are independent traversal options
pub fn walk_tree_entry(
package_name: &PackageName,
recipe_map: &HashMap<&PackageName, &CookRecipe>,
+1
View File
@@ -275,6 +275,7 @@ impl CookRecipe {
Self::new(name, dir.to_path_buf(), recipe)
}
#[allow(clippy::too_many_arguments)] // params are independent recursion flags
fn new_recursive(
names: &[PackageName],
recurse_build_deps: bool,
+1 -3
View File
@@ -97,9 +97,7 @@ pub fn new_recursive(
return Ok(vec![]);
}
let (list, map) = new_recursive_nonstop(names, recursion);
if nonstop && !list.is_empty() {
Ok(list)
} else if !nonstop && map.len() == list.len() {
if (nonstop && !list.is_empty()) || (!nonstop && map.len() == list.len()) {
Ok(list)
} else {
let (_, res) = map.into_iter().find(|(_, v)| v.is_err()).unwrap();