keymap: format the conflicts_with test

This commit is contained in:
aiongg committed 2026-10-19 04:25:06 +00:00
1 parent 48c0e1b59d
commit 66f22029ba
1 file changed
+9 -2
+9 -2
View File
@@ -256,12 +256,19 @@ fn conflicts_tell_clashes_from_shadows() {
assert!(with("nope").is_empty());
for entry in km.catalogue() {
let id = entry.command.id.as_str();
let mut direct: Vec<_> = km.conflicts_with(&entry.command).into_iter().map(|c| (c.chord, c.a.0.id, c.b.0.id, c.kind, c.in_defaults)).collect();
let mut direct: Vec<_> =
km.conflicts_with(&entry.command).into_iter().map(|c| (c.chord, c.a.0.id, c.b.0.id, c.kind, c.in_defaults)).collect();
let mut filtered: Vec<_> = km
.conflicts()
.into_iter()
.filter(|c| c.a.0.id == id || c.b.0.id == id)
.map(|c| if c.a.0.id == id { (c.chord, c.a.0.id, c.b.0.id, c.kind, c.in_defaults) } else { (c.chord, c.b.0.id, c.a.0.id, c.kind, c.in_defaults) })
.map(|c| {
if c.a.0.id == id {
(c.chord, c.a.0.id, c.b.0.id, c.kind, c.in_defaults)
} else {
(c.chord, c.b.0.id, c.a.0.id, c.kind, c.in_defaults)
}
})
.collect();
direct.sort();
filtered.sort();