summaryrefslogtreecommitdiffstats
path: root/src/query/scorer.rs
diff options
context:
space:
mode:
authorPaul Masurel <paul.masurel@gmail.com>2019-01-28 11:43:42 +0100
committerGitHub <noreply@github.com>2019-01-28 11:43:42 +0100
commit6a547b0b5fb25a6f7ae9841f94084762be449b0b (patch)
tree1097405a28ef110b82526cd87ba4a1e8a4883f56 /src/query/scorer.rs
parente99d1a2355089468489fd2d6aa8c6645ba39fcf1 (diff)
Issue/483 (#484)
* Downcast_ref * fixing unit test
Diffstat (limited to 'src/query/scorer.rs')
-rw-r--r--src/query/scorer.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/query/scorer.rs b/src/query/scorer.rs
index a2e40fa..99d529b 100644
--- a/src/query/scorer.rs
+++ b/src/query/scorer.rs
@@ -1,6 +1,6 @@
use common::BitSet;
use docset::{DocSet, SkipResult};
-use downcast;
+use downcast_rs;
use std::ops::DerefMut;
use DocId;
use Score;
@@ -8,7 +8,7 @@ use Score;
/// Scored set of documents matching a query within a specific segment.
///
/// See [`Query`](./trait.Query.html).
-pub trait Scorer: downcast::Any + DocSet + 'static {
+pub trait Scorer: downcast_rs::Downcast + DocSet + 'static {
/// Returns the score.
///
/// This method will perform a bit of computation and is not cached.
@@ -23,10 +23,8 @@ pub trait Scorer: downcast::Any + DocSet + 'static {
}
}
-#[allow(missing_docs)]
-mod downcast_impl {
- downcast!(super::Scorer);
-}
+impl_downcast!(Scorer);
+
impl Scorer for Box<Scorer> {
fn score(&mut self) -> Score {