diff --git a/instant-distance-py/Cargo.toml b/instant-distance-py/Cargo.toml index 5a3e1a9..d431b0d 100644 --- a/instant-distance-py/Cargo.toml +++ b/instant-distance-py/Cargo.toml @@ -2,7 +2,8 @@ name = "instant-distance-py" version = "0.3.2" authors = ["Dirkjan Ochtman "] -edition = "2018" +edition = "2021" +rust-version = "1.58" license = "MIT OR Apache-2.0" workspace = ".." description = "Fast minimal implementation of HNSW maps for approximate nearest neighbors searches" diff --git a/instant-distance-py/src/lib.rs b/instant-distance-py/src/lib.rs index a41907f..bc35090 100644 --- a/instant-distance-py/src/lib.rs +++ b/instant-distance-py/src/lib.rs @@ -58,7 +58,7 @@ impl HnswMap { bincode::deserialize_from::<_, instant_distance::HnswMap>( BufReader::with_capacity(32 * 1024 * 1024, File::open(fname)?), ) - .map_err(|e| PyValueError::new_err(format!("deserialization error: {:?}", e)))?; + .map_err(|e| PyValueError::new_err(format!("deserialization error: {e:?}")))?; Ok(Self { inner: hnsw_map }) } @@ -66,7 +66,7 @@ impl HnswMap { fn dump(&self, fname: &str) -> PyResult<()> { let f = BufWriter::with_capacity(32 * 1024 * 1024, File::create(fname)?); bincode::serialize_into(f, &self.inner) - .map_err(|e| PyValueError::new_err(format!("serialization error: {:?}", e)))?; + .map_err(|e| PyValueError::new_err(format!("serialization error: {e:?}")))?; Ok(()) } @@ -115,7 +115,7 @@ impl Hnsw { let hnsw = bincode::deserialize_from::<_, instant_distance::Hnsw>( BufReader::with_capacity(32 * 1024 * 1024, File::open(fname)?), ) - .map_err(|e| PyValueError::new_err(format!("deserialization error: {:?}", e)))?; + .map_err(|e| PyValueError::new_err(format!("deserialization error: {e:?}")))?; Ok(Self { inner: hnsw }) } @@ -123,7 +123,7 @@ impl Hnsw { fn dump(&self, fname: &str) -> PyResult<()> { let f = BufWriter::with_capacity(32 * 1024 * 1024, File::create(fname)?); bincode::serialize_into(f, &self.inner) - .map_err(|e| PyValueError::new_err(format!("serialization error: {:?}", e)))?; + .map_err(|e| PyValueError::new_err(format!("serialization error: {e:?}")))?; Ok(()) } diff --git a/instant-distance/Cargo.toml b/instant-distance/Cargo.toml index caeec1a..f316231 100644 --- a/instant-distance/Cargo.toml +++ b/instant-distance/Cargo.toml @@ -3,7 +3,8 @@ name = "instant-distance" version = "0.6.0" license = "MIT OR Apache-2.0" authors = ["Dirkjan Ochtman "] -edition = "2018" +edition = "2021" +rust-version = "1.58" description = "Fast minimal implementation of HNSW maps for approximate nearest neighbors searches" homepage = "https://github.com/InstantDomain/instant-distance" repository = "https://github.com/InstantDomain/instant-distance" diff --git a/instant-distance/tests/all.rs b/instant-distance/tests/all.rs index 013327f..276f71c 100644 --- a/instant-distance/tests/all.rs +++ b/instant-distance/tests/all.rs @@ -16,7 +16,7 @@ fn map() { let values = vec!["zero", "one", "two", "three", "four"]; let seed = ThreadRng::default().gen::(); - println!("map (seed = {})", seed); + println!("map (seed = {seed})"); let map = Builder::default().seed(seed).build(points, values); let mut search = Search::default(); @@ -42,15 +42,15 @@ fn map() { #[test] fn random_heuristic() { let (seed, recall) = randomized(Builder::default()); - println!("heuristic (seed = {}) recall = {}", seed, recall); - assert!(recall > 97, "expected at least 98, got {}", recall); + println!("heuristic (seed = {seed}) recall = {recall}"); + assert!(recall > 97, "expected at least 98, got {recall}"); } #[test] fn random_simple() { let (seed, recall) = randomized(Builder::default().select_heuristic(None)); - println!("simple (seed = {}) recall = {}", seed, recall); - assert!(recall > 90, "expected at least 90, got {}", recall); + println!("simple (seed = {seed}) recall = {recall}"); + assert!(recall > 90, "expected at least 90, got {recall}"); } fn randomized(builder: Builder) -> (u64, usize) {