Skip to content

Commit

Permalink
Update tui/src/filter.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Liam <[email protected]>
  • Loading branch information
jeevithakannan2 and lj3954 authored Nov 12, 2024
1 parent 02b0612 commit df81642
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tui/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,9 @@ impl Filter {
} else {
let input = self.search_input.iter().collect::<String>().to_lowercase();
self.items.iter().find_map(|item| {
let item_name_lower = &item.node.name.to_lowercase();
if item_name_lower.starts_with(&input) {
Some(item_name_lower[input.len()..].to_string())
} else {
None
}
let item_name_lower = item.node.name.to_lowercase();
(item_name_lower.starts_with(&input))
.then_some(item_name_lower[input.len()..].to_string())
})
}
}
Expand Down

0 comments on commit df81642

Please sign in to comment.