aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-07 08:13:26 +0000
committerBlaž Hrastnik2021-05-07 08:13:26 +0000
commit87e7a0de3fae7ccdd7e2b69908a8875eeb49f24c (patch)
treead9a1a86f826fae778c2cf3d62a8dd1486af4cda
parentdbeae43fbe27e968392c14243edb01f5fdcafc4c (diff)
Save space by having the command hashmap use const static refs.
-rw-r--r--helix-term/src/commands.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 338468c2..758d3c49 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -905,13 +905,13 @@ mod cmd {
},
];
- pub static COMMANDS: Lazy<HashMap<&'static str, Command>> = Lazy::new(|| {
+ pub static COMMANDS: Lazy<HashMap<&'static str, &'static Command>> = Lazy::new(|| {
let mut map = HashMap::new();
for cmd in COMMAND_LIST {
- map.insert(cmd.name, cmd.clone());
+ map.insert(cmd.name, cmd);
if let Some(alias) = cmd.alias {
- map.insert(alias, cmd.clone());
+ map.insert(alias, cmd);
}
}