Compare commits

..

1 Commits

Author SHA1 Message Date
Jeevitha Kannan K S
af2caa8d1a
Merge 02b06129e1 into 7147ed93e9 2024-11-11 18:58:12 +00:00

View File

@ -93,9 +93,12 @@ 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();
(item_name_lower.starts_with(&input)) if item_name_lower.starts_with(&input) {
.then_some(item_name_lower[input.len()..].to_string()) Some(item_name_lower[input.len()..].to_string())
} else {
None
}
}) })
} }
} }