Skip to main content

matches_search_in

Function matches_search_in 

Source
pub fn matches_search_in(locale: &str, text: &str, query: &str) -> bool
Expand description

Whether text matches query under locale’s rules (untracked: pass the locale explicitly).

An empty or whitespace-only query matches everything, so an empty search box filters nothing.

assert!(day_l10n::matches_search_in("en", "Canvas & shapes", "s"));
assert!(day_l10n::matches_search_in("en", "Canvas & shapes", "canvas &"));
assert!(!day_l10n::matches_search_in("en", "Toolbars", "s"));