diff options
author | Kornel <kornel@geekhood.net> | 2019-08-05 14:21:22 +0100 |
---|---|---|
committer | Paul Masurel <paul.masurel@gmail.com> | 2019-08-05 22:21:22 +0900 |
commit | 754b55eee5393557199464eec0b528e57f35cbac (patch) | |
tree | 294e61cf1926259a9c9a2af93be22f19c494a2cf | |
parent | 280ea1209cab3c112578970dc8b9fd0fdefc63a9 (diff) |
Bump deps (#613)
* Bump crossbeam
* Warnings--
* Remove outdated tempdir
-rw-r--r-- | Cargo.toml | 3 | ||||
-rw-r--r-- | examples/basic_search.rs | 4 | ||||
-rw-r--r-- | examples/faceted_search.rs | 4 | ||||
-rw-r--r-- | examples/snippet.rs | 4 | ||||
-rw-r--r-- | src/collector/top_score_collector.rs | 2 | ||||
-rw-r--r-- | src/core/index.rs | 6 | ||||
-rw-r--r-- | src/directory/managed_directory.rs | 6 | ||||
-rw-r--r-- | src/directory/mmap_directory.rs | 6 | ||||
-rw-r--r-- | src/indexer/index_writer.rs | 1 | ||||
-rwxr-xr-x | src/lib.rs | 6 | ||||
-rw-r--r-- | tests/failpoints/mod.rs | 2 |
11 files changed, 21 insertions, 23 deletions
@@ -25,7 +25,6 @@ atomicwrites = {version="0.2.2", optional=true} tempfile = "3.0" log = "0.4" combine = ">=3.6.0,<4.0.0" -tempdir = "0.3" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" @@ -36,7 +35,7 @@ levenshtein_automata = {version="0.1", features=["fst_automaton"]} notify = {version="4", optional=true} bit-set = "0.5" uuid = { version = "0.7.2", features = ["v4", "serde"] } -crossbeam = "0.5" +crossbeam = "0.7" futures = "0.1" futures-cpupool = "0.1" owning_ref = "0.4" diff --git a/examples/basic_search.rs b/examples/basic_search.rs index 416f86f..2715114 100644 --- a/examples/basic_search.rs +++ b/examples/basic_search.rs @@ -19,12 +19,12 @@ use tantivy::query::QueryParser; use tantivy::schema::*; use tantivy::Index; use tantivy::ReloadPolicy; -use tempdir::TempDir; +use tempfile::TempDir; fn main() -> tantivy::Result<()> { // Let's create a temporary directory for the // sake of this example - let index_path = TempDir::new("tantivy_example_dir")?; + let index_path = TempDir::new()?; // # Defining the schema // diff --git a/examples/faceted_search.rs b/examples/faceted_search.rs index 98e0a27..0947774 100644 --- a/examples/faceted_search.rs +++ b/examples/faceted_search.rs @@ -18,11 +18,12 @@ use tantivy::collector::FacetCollector; use tantivy::query::AllQuery; use tantivy::schema::*; use tantivy::Index; +use tempfile::TempDir; fn main() -> tantivy::Result<()> { // Let's create a temporary directory for the // sake of this example - let index_path = TempDir::new("tantivy_facet_example_dir")?; + let index_path = TempDir::new()?; let mut schema_builder = Schema::builder(); schema_builder.add_text_field("name", TEXT | STORED); @@ -75,4 +76,3 @@ fn main() -> tantivy::Result<()> { Ok(()) } -use tempdir::TempDir; diff --git a/examples/snippet.rs b/examples/snippet.rs index 0d87834..054d760 100644 --- a/examples/snippet.rs +++ b/examples/snippet.rs @@ -14,12 +14,12 @@ use tantivy::query::QueryParser; use tantivy::schema::*; use tantivy::Index; use tantivy::{Snippet, SnippetGenerator}; -use tempdir::TempDir; +use tempfile::TempDir; fn main() -> tantivy::Result<()> { // Let's create a temporary directory for the // sake of this example - let index_path = TempDir::new("tantivy_example_dir")?; + let index_path = TempDir::new()?; // # Defining the schema let mut schema_builder = Schema::builder(); diff --git a/src/collector/top_score_collector.rs b/src/collector/top_score_collector.rs index 21a88be..64ebe59 100644 --- a/src/collector/top_score_collector.rs +++ b/src/collector/top_score_collector.rs @@ -591,7 +591,7 @@ mod tests { query_field: Field, schema: Schema, mut doc_adder: impl FnMut(&mut IndexWriter) -> (), - ) -> (Index, Box<Query>) { + ) -> (Index, Box<dyn Query>) { let index = Index::create_in_ram(schema); let mut index_writer = index.writer_with_num_threads(1, 3_000_000).unwrap(); diff --git a/src/core/index.rs b/src/core/index.rs index c3def31..1abe07d 100644 --- a/src/core/index.rs +++ b/src/core/index.rs @@ -459,13 +459,13 @@ mod tests { use super::*; use std::path::PathBuf; - use tempdir::TempDir; + use tempfile::TempDir; #[test] fn test_index_on_commit_reload_policy_mmap() { let schema = throw_away_schema(); let field = schema.get_field("num_likes").unwrap(); - let tempdir = TempDir::new("index").unwrap(); + let tempdir = TempDir::new().unwrap(); let tempdir_path = PathBuf::from(tempdir.path()); let index = Index::create_in_dir(&tempdir_path, schema).unwrap(); let mut writer = index.writer_with_num_threads(1, 3_000_000).unwrap(); @@ -504,7 +504,7 @@ mod tests { fn test_index_on_commit_reload_policy_different_directories() { let schema = throw_away_schema(); let field = schema.get_field("num_likes").unwrap(); - let tempdir = TempDir::new("index").unwrap(); + let tempdir = TempDir::new().unwrap(); let tempdir_path = PathBuf::from(tempdir.path()); let write_index = Index::create_in_dir(&tempdir_path, schema).unwrap(); let read_index = Index::open_in_dir(&tempdir_path).unwrap(); diff --git a/src/directory/managed_directory.rs b/src/directory/managed_directory.rs index c33ff1b..859e66d 100644 --- a/src/directory/managed_directory.rs +++ b/src/directory/managed_directory.rs @@ -263,11 +263,11 @@ mod tests_mmap_specific { use std::collections::HashSet; use std::io::Write; use std::path::{Path, PathBuf}; - use tempdir::TempDir; + use tempfile::TempDir; #[test] fn test_managed_directory() { - let tempdir = TempDir::new("tantivy-test").unwrap(); + let tempdir = TempDir::new().unwrap(); let tempdir_path = PathBuf::from(tempdir.path()); let test_path1: &'static Path = Path::new("some_path_for_test"); @@ -304,7 +304,7 @@ mod tests_mmap_specific { fn test_managed_directory_gc_while_mmapped() { let test_path1: &'static Path = Path::new("some_path_for_test"); - let tempdir = TempDir::new("index").unwrap(); + let tempdir = TempDir::new().unwrap(); let tempdir_path = PathBuf::from(tempdir.path()); let living_files = HashSet::new(); diff --git a/src/directory/mmap_directory.rs b/src/directory/mmap_directory.rs index afe90b8..4b1bc03 100644 --- a/src/directory/mmap_directory.rs +++ b/src/directory/mmap_directory.rs @@ -36,7 +36,7 @@ use std::sync::Mutex; use std::sync::RwLock; use std::sync::Weak; use std::thread; -use tempdir::TempDir; +use tempfile::TempDir; /// Create a default io error given a string. pub(crate) fn make_io_err(msg: String) -> io::Error { @@ -294,7 +294,7 @@ impl MmapDirectory { /// This is mostly useful to test the MmapDirectory itself. /// For your unit tests, prefer the RAMDirectory. pub fn create_from_tempdir() -> Result<MmapDirectory, OpenDirectoryError> { - let tempdir = TempDir::new("index").map_err(OpenDirectoryError::IoError)?; + let tempdir = TempDir::new().map_err(OpenDirectoryError::IoError)?; let tempdir_path = PathBuf::from(tempdir.path()); MmapDirectory::new(tempdir_path, Some(tempdir)) } @@ -642,7 +642,7 @@ mod tests { fn test_watch_wrapper() { let counter: Arc<AtomicUsize> = Default::default(); let counter_clone = counter.clone(); - let tmp_dir: TempDir = tempdir::TempDir::new("test_watch_wrapper").unwrap(); + let tmp_dir = tempfile::TempDir::new().unwrap(); let tmp_dirpath = tmp_dir.path().to_owned(); let mut watch_wrapper = WatcherWrapper::new(&tmp_dirpath).unwrap(); let tmp_file = tmp_dirpath.join("coucou"); diff --git a/src/indexer/index_writer.rs b/src/indexer/index_writer.rs index fa5ae0b..5210281 100644 --- a/src/indexer/index_writer.rs +++ b/src/indexer/index_writer.rs @@ -761,7 +761,6 @@ mod tests { use crate::Index; use crate::ReloadPolicy; use crate::Term; - use fail; #[test] fn test_operations_group() { @@ -12,7 +12,7 @@ //! //! ```rust -//! # extern crate tempdir; +//! # extern crate tempfile; //! # //! #[macro_use] //! extern crate tantivy; @@ -20,7 +20,7 @@ //! // ... //! //! # use std::path::Path; -//! # use tempdir::TempDir; +//! # use tempfile::TempDir; //! # use tantivy::Index; //! # use tantivy::schema::*; //! # use tantivy::{Score, DocAddress}; @@ -30,7 +30,7 @@ //! # fn main() { //! # // Let's create a temporary directory for the //! # // sake of this example -//! # if let Ok(dir) = TempDir::new("tantivy_example_dir") { +//! # if let Ok(dir) = TempDir::new() { //! # run_example(dir.path()).unwrap(); //! # dir.close().unwrap(); //! # } diff --git a/tests/failpoints/mod.rs b/tests/failpoints/mod.rs index f8360b3..807ca7a 100644 --- a/tests/failpoints/mod.rs +++ b/tests/failpoints/mod.rs @@ -8,7 +8,7 @@ use tantivy::{Index, Term}; #[test] fn test_failpoints_managed_directory_gc_if_delete_fails() { - let scenario = fail::FailScenario::setup(); + let _scenario = fail::FailScenario::setup(); let test_path: &'static Path = Path::new("some_path_for_test"); |