diff options
| -rw-r--r-- | src/config/mod.rs | 7 | ||||
| -rw-r--r-- | src/repl/completer.rs | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 1b3d802..76ddd4c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -473,12 +473,10 @@ impl Config { } else { return vec![]; }; - let mut values: Vec<String> = values + values .into_iter() .filter(|v| v.starts_with(filter)) - .collect(); - values.sort_unstable(); - values + .collect() } pub fn update(&mut self, data: &str) -> Result<()> { @@ -616,6 +614,7 @@ impl Config { names.push(name.to_string()); } } + names.sort_unstable(); names } Err(_) => vec![], diff --git a/src/repl/completer.rs b/src/repl/completer.rs index 02c34a6..b5d4ddb 100644 --- a/src/repl/completer.rs +++ b/src/repl/completer.rs @@ -86,8 +86,7 @@ impl ReplCompleter { pub fn new(config: &GlobalConfig) -> Self { let mut groups = HashMap::new(); - let mut commands: Vec<ReplCommand> = REPL_COMMANDS.to_vec(); - commands.sort_by(|a, b| a.name.cmp(b.name)); + let commands: Vec<ReplCommand> = REPL_COMMANDS.to_vec(); for cmd in REPL_COMMANDS.iter() { let name = cmd.name; |
