Patterns: satisfy clippy's simplified boolean check

The pre-existing swatch name-clash test is a negated conjunction that clippy 1.95 flags as nonminimal_bool, which stopped cargo xtask ci before this PR's crates were checked. Rewrite it as the equivalent disjunction; no behaviour change.
This commit is contained in:
Adam
2026-10-21 03:27:43 +02:00
parent 2c363d6b88
commit 28d0eba3d8
+1 -1
View File
@@ -491,7 +491,7 @@ fn swatch_name_clash(d: &Document, old: &str, new: &str) -> bool {
let own = |w: &vectorcraft_color::Swatch| pattern_name(&w.paint).is_some_and(|p| p == old);
let mut holders = d.swatches_iter().filter(|w| w.name == new).peekable();
let only_own = holders.peek().is_some() && holders.all(own);
d.swatch_name_taken(new) && !(only_own && !d.swatches_iter().any(|w| w.name == old && own(w)))
d.swatch_name_taken(new) && (d.swatches_iter().any(|w| w.name == old && own(w)) || !only_own)
}
/// Rename a pattern in swatches, paints and the edit record. Of the swatches named `old`, only the