Compare commits

...

2 Commits

Author SHA1 Message Date
Jeevitha Kannan K S
caf795fc8d
Merge df81642c9e into 7147ed93e9 2024-11-12 15:37:45 +00:00
Jeevitha Kannan K S
df81642c9e
Update tui/src/filter.rs
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-12 21:07:43 +05:30

View File

@ -93,12 +93,9 @@ impl Filter {
} else { } else {
let input = self.search_input.iter().collect::<String>().to_lowercase(); let input = self.search_input.iter().collect::<String>().to_lowercase();
self.items.iter().find_map(|item| { self.items.iter().find_map(|item| {
let item_name_lower = &item.node.name.to_lowercase(); let item_name_lower = item.node.name.to_lowercase();
if item_name_lower.starts_with(&input) { (item_name_lower.starts_with(&input))
Some(item_name_lower[input.len()..].to_string()) .then_some(item_name_lower[input.len()..].to_string())
} else {
None
}
}) })
} }
} }