mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-29 13:32:09 +03:00
Save space by having the command hashmap use const static refs.
This commit is contained in:
parent
dbeae43fbe
commit
87e7a0de3f
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user