From 0d07af3caf432f6a4c62125f5765c191881f637a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sun, 6 Jan 2019 11:41:47 +0100 Subject: [PATCH] fix: Filter and count the exact matching words --- src/rank/criterion/exact.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rank/criterion/exact.rs b/src/rank/criterion/exact.rs index 6d33a6f38..759bd951e 100644 --- a/src/rank/criterion/exact.rs +++ b/src/rank/criterion/exact.rs @@ -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)]