diff --git a/src/search.rs b/src/search.rs index 12480e5..f6cbf25 100644 --- a/src/search.rs +++ b/src/search.rs @@ -51,7 +51,7 @@ impl Rustysearch { /// version of ``rustysearch`` & zero docs (used in scoring). /// pub fn read_stats(&self) -> std::io::Result { - let mut stats: Stats; + let stats: Stats; if !Path::new(&self.stats_path).exists() { stats = Stats { diff --git a/tests/rustysearch.rs b/tests/rustysearch.rs index 1e6ce01..90e9a93 100644 --- a/tests/rustysearch.rs +++ b/tests/rustysearch.rs @@ -1,10 +1,7 @@ #[cfg(test)] mod tests { - use std::{thread::{self}, time::{self, Duration}}; use rustysearch::{types::Stats, search::Rustysearch}; - const TEN_MILLIS: Duration = time::Duration::from_millis(100); - #[test] fn test_write_new_stats(){ let stats = Stats{ @@ -19,7 +16,6 @@ mod tests { search.setup(); search.write_stats(stats).unwrap(); - thread::sleep(TEN_MILLIS); } #[test] @@ -32,7 +28,6 @@ mod tests { let stats = search.read_stats().unwrap(); assert_eq!(stats.version, "0.1.0"); assert_eq!(stats.total_docs, 0); - thread::sleep(TEN_MILLIS); } #[test] @@ -48,7 +43,6 @@ mod tests { search.increment_total_docs(); let stats = search.read_stats().unwrap(); assert_eq!(stats.total_docs, 1); - thread::sleep(TEN_MILLIS); } #[test] @@ -67,7 +61,6 @@ mod tests { let total_docs = search.get_total_docs(); assert_eq!(total_docs, 1); - thread::sleep(TEN_MILLIS); } fn clean_stats(){ @@ -79,6 +72,5 @@ mod tests { total_docs: 0, }; search.write_stats(new_stats).unwrap(); - thread::sleep(TEN_MILLIS); } } \ No newline at end of file