Sonar: reduce cognitive complexity in highlight, review and outline commands

This commit is contained in:
Dylan M. Taylor
2026-10-26 16:01:36 -04:00
committed by GitHub
parent 6a2b520fa4
commit d859c673c1
18 changed files with 216 additions and 181 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ pub fn run(args: &[&str]) -> Result<(), String> {
None => 100,
};
let pos: Vec<&str> =
args.iter().enumerate().filter(|(i, a)| !a.starts_with("--") && !(*i > 0 && args[i - 1] == "--dpi")).map(|(_, a)| *a).collect();
args.iter().enumerate().filter(|(i, a)| !(a.starts_with("--") || *i > 0 && args[i - 1] == "--dpi")).map(|(_, a)| *a).collect();
let [reference, test, out] = pos.as_slice() else {
return Err("usage: cargo xtask visual-diff REF.pdf TEST.pdf OUTDIR [--private] [--dpi N]".into());
};