Unnamed repository; edit this file 'description' to name the repository.
Simplify BTreeSet construction
Co-authored-by: Ivan Tham <[email protected]>
Triton171 2021-11-03
parent eb8745d · commit 7a0c432
-rw-r--r--helix-term/src/keymap.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs
index 827f71d9..72d0a733 100644
--- a/helix-term/src/keymap.rs
+++ b/helix-term/src/keymap.rs
@@ -147,11 +147,7 @@ impl KeyTrieNode {
Some(pos) => {
body[pos].1.insert(key);
}
- None => {
- let mut keys = BTreeSet::new();
- keys.insert(key);
- body.push((desc, keys));
- }
+ None => body.push((desc, BTreeSet::from([key]))),
}
}
body.sort_unstable_by_key(|(_, keys)| {