fix: Filter and count the exact matching words

This commit is contained in:
Clément Renault 2019-01-06 11:41:47 +01:00
parent c594597a01
commit 0d07af3caf
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE

View File

@ -9,13 +9,13 @@ use crate::database::DatabaseView;
use crate::Match;
#[inline]
fn contains_exact(matches: &[Match]) -> bool {
fn contains_exact(matches: &&[Match]) -> bool {
matches.iter().any(|m| m.is_exact)
}
#[inline]
fn number_exact_matches(matches: &Matches) -> usize {
matches.query_index_groups().map(contains_exact).count()
matches.query_index_groups().filter(contains_exact).count()
}
#[derive(Debug, Clone, Copy)]