This commit is contained in:
Andras Schmelczer 2026-05-06 23:13:58 +01:00
parent 94f9c0d594
commit 5c3b87f2d5
69 changed files with 1334 additions and 213 deletions

View file

@ -383,6 +383,7 @@ fn token_matches_numeric_term(token: &str, query_term: &str) -> bool {
token == query_term || token.starts_with(query_term)
}
#[cfg(test)]
fn address_tokens_match_group(tokens: &[String], group: &AddressTermGroup) -> bool {
group.alternatives.iter().any(|alternative| {
tokens
@ -654,7 +655,7 @@ impl PropertyData {
for term in terms {
if let Some(rows) = self.address_token_index.get(term) {
if best.map_or(true, |current| rows.len() < current.len()) {
if best.is_none_or(|current| rows.len() < current.len()) {
best = Some(rows.as_slice());
}
continue;
@ -670,7 +671,7 @@ impl PropertyData {
continue;
}
if let Some(rows) = self.address_token_index.get(token) {
if best.map_or(true, |current| rows.len() < current.len()) {
if best.is_none_or(|current| rows.len() < current.len()) {
best = Some(rows.as_slice());
}
}