From 72fc1c10a63113f8db4aae949bc61bc316f63eee Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Tue, 3 Sep 2019 09:56:27 +0900 Subject: [PATCH] rebasing, fixing some test --- src/lib.rs | 5 ----- src/query/bitset/mod.rs | 4 ---- tantivy-schema/src/lib.rs | 6 +++--- tantivy-schema/src/schema.rs | 4 ++-- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b6b121179..69b4b9f89 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -252,7 +252,6 @@ mod tests { use crate::Postings; use crate::ReloadPolicy; use rand::distributions::Bernoulli; - use rand::distributions::Uniform; use rand::rngs::StdRng; use rand::{Rng, SeedableRng}; @@ -278,10 +277,6 @@ mod tests { .collect() } - pub fn sample(n: u32, ratio: f64) -> Vec { - sample_with_seed(n, ratio, 4) - } - #[test] #[cfg(feature = "mmap")] fn test_indexing() { diff --git a/src/query/bitset/mod.rs b/src/query/bitset/mod.rs index 48c9d089f..f345225a3 100644 --- a/src/query/bitset/mod.rs +++ b/src/query/bitset/mod.rs @@ -124,10 +124,6 @@ mod tests { use crate::common::BitSet; use crate::docset::{DocSet, SkipResult}; use crate::DocId; - use rand::distributions::Uniform; - use rand::rngs::StdRng; - use rand::{Rng, SeedableRng}; - use std::collections::BTreeSet; fn create_docbitset(docs: &[DocId], max_doc: DocId) -> BitSetDocSet { let mut docset = BitSet::with_max_value(max_doc); diff --git a/tantivy-schema/src/lib.rs b/tantivy-schema/src/lib.rs index a763d7958..049bb2153 100644 --- a/tantivy-schema/src/lib.rs +++ b/tantivy-schema/src/lib.rs @@ -26,7 +26,7 @@ directory. ### Example ``` -use tantivy::schema::*; +use tantivy_schema::*; let mut schema_builder = Schema::builder(); let title_options = TextOptions::default() .set_stored() @@ -59,7 +59,7 @@ when [`searcher.doc(doc_address)`](../struct.Searcher.html#method.doc) is called ### Example ``` -use tantivy::schema::*; +use tantivy_schema::*; let mut schema_builder = Schema::builder(); let num_stars_options = IntOptions::default() .set_stored() @@ -93,7 +93,7 @@ using the `|` operator. For instance, a schema containing the two fields defined in the example above could be rewritten : ``` -use tantivy::schema::*; +use tantivy_schema::*; let mut schema_builder = Schema::builder(); schema_builder.add_u64_field("num_stars", INDEXED | STORED); schema_builder.add_text_field("title", TEXT | STORED); diff --git a/tantivy-schema/src/schema.rs b/tantivy-schema/src/schema.rs index 9ba3879d0..2e01552a1 100644 --- a/tantivy-schema/src/schema.rs +++ b/tantivy-schema/src/schema.rs @@ -21,7 +21,7 @@ use std::sync::Arc; /// # Examples /// /// ``` -/// use tantivy::schema::*; +/// use tantivy_schema::*; /// /// let mut schema_builder = Schema::builder(); /// let id_field = schema_builder.add_text_field("id", STRING); @@ -208,7 +208,7 @@ impl Eq for InnerSchema {} /// # Examples /// /// ``` -/// use tantivy::schema::*; +/// use tantivy_schema::*; /// /// let mut schema_builder = Schema::builder(); /// let id_field = schema_builder.add_text_field("id", STRING);