mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-09 12:04:09 +00:00
keymap: format the conflicts_with test
This commit is contained in:
1 parent
48c0e1b59d
commit
66f22029ba
1 file changed
+9
-2
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user