From 7a6166d2292e2e73f95c0633ff9ce37605aa8423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sun, 3 Feb 2019 10:55:16 +0100 Subject: [PATCH] feat: Make the QueryBuilder with_criteria use FilterFunc --- src/rank/query_builder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rank/query_builder.rs b/src/rank/query_builder.rs index e6c49be6d..1dced5ba3 100644 --- a/src/rank/query_builder.rs +++ b/src/rank/query_builder.rs @@ -53,15 +53,15 @@ where D: Deref pub fn new(view: &'a DatabaseView) -> Result> { QueryBuilder::with_criteria(view, Criteria::default()) } + + pub fn with_criteria(view: &'a DatabaseView, criteria: Criteria) -> Result> { + Ok(QueryBuilder { view, criteria, filter: None }) + } } impl<'a, D, FI> QueryBuilder<'a, D, FI> where D: Deref, { - pub fn with_criteria(view: &'a DatabaseView, criteria: Criteria) -> Result> { - Ok(QueryBuilder { view, criteria, filter: None }) - } - pub fn with_filter(self, function: F) -> QueryBuilder<'a, D, F> where F: Fn(DocumentId, &DatabaseView) -> bool, {