diff options
author | Paul Masurel <paul.masurel@gmail.com> | 2019-07-01 10:01:46 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-01 10:01:46 +0900 |
commit | 462774b15cdb81860d070c883d5b140884ff95db (patch) | |
tree | 8e39eb1adb567d51054bb6b6db08ff594987652f /src/query/scorer.rs | |
parent | 185a5b8d3159123b316018161d825bc5ce5c5f52 (diff) |
Tiqb feature/2018 (#583)
* rust 2018
* Added CHANGELOG comment
Diffstat (limited to 'src/query/scorer.rs')
-rw-r--r-- | src/query/scorer.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/query/scorer.rs b/src/query/scorer.rs index 55f9ee1..2dbae69 100644 --- a/src/query/scorer.rs +++ b/src/query/scorer.rs @@ -1,9 +1,9 @@ -use common::BitSet; -use docset::{DocSet, SkipResult}; +use crate::common::BitSet; +use crate::docset::{DocSet, SkipResult}; +use crate::DocId; +use crate::Score; use downcast_rs; use std::ops::DerefMut; -use DocId; -use Score; /// Scored set of documents matching a query within a specific segment. /// @@ -16,7 +16,7 @@ pub trait Scorer: downcast_rs::Downcast + DocSet + 'static { /// Iterates through all of the document matched by the DocSet /// `DocSet` and push the scored documents to the collector. - fn for_each(&mut self, callback: &mut FnMut(DocId, Score)) { + fn for_each(&mut self, callback: &mut dyn FnMut(DocId, Score)) { while self.advance() { callback(self.doc(), self.score()); } @@ -25,12 +25,12 @@ pub trait Scorer: downcast_rs::Downcast + DocSet + 'static { impl_downcast!(Scorer); -impl Scorer for Box<Scorer> { +impl Scorer for Box<dyn Scorer> { fn score(&mut self) -> Score { self.deref_mut().score() } - fn for_each(&mut self, callback: &mut FnMut(DocId, Score)) { + fn for_each(&mut self, callback: &mut dyn FnMut(DocId, Score)) { let scorer = self.deref_mut(); scorer.for_each(callback); } |