diff options
author | Blaž Hrastnik | 2022-11-04 12:01:17 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-11-04 12:06:28 +0000 |
commit | c2c1280f02b83a468da67d88350c199915427535 (patch) | |
tree | cd4306c1b7353bb960608e18c5633aa22c5d0204 /helix-term/src/commands.rs | |
parent | 921d3510132b0bd89d4ac0a542371c3ae90e2e02 (diff) |
Resolve a bunch of upcoming clippy lints
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index ee9bad98..aae9979d 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3933,15 +3933,12 @@ pub fn completion(cx: &mut Context) { }; if !prefix.is_empty() { - items = items - .into_iter() - .filter(|item| { - item.filter_text - .as_ref() - .unwrap_or(&item.label) - .starts_with(&prefix) - }) - .collect(); + items.retain(|item| { + item.filter_text + .as_ref() + .unwrap_or(&item.label) + .starts_with(&prefix) + }); } if items.is_empty() { |