Skip to content

Commit

Permalink
fix formatting and improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanhitc committed Jan 26, 2022
1 parent cb1e9a5 commit e4ffea8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ impl Default for MyCompletion {
impl Completion for MyCompletion {
/// Simple completion implementation based on substring
fn get(&self, input: &str) -> Option<String> {
let matches = self.options.iter().filter(|x| x.starts_with(input)).collect::<Vec<_>>();
let matches = self
.options
.iter()
.filter(|option| option.starts_with(input))
.collect::<Vec<_>>();

if matches.len() == 1 {
Some(matches[0].to_string())
} else {
Expand Down

0 comments on commit e4ffea8

Please sign in to comment.