mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 13:33:19 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user