From 3b3c1ca39d76efe6d9ffeebf1d79a075d9129dba Mon Sep 17 00:00:00 2001 From: jean-pierreBoth Date: Wed, 17 Apr 2024 15:11:07 +0200 Subject: [PATCH] fix small bug due to path change in distances name in reloading --- src/hnswio.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hnswio.rs b/src/hnswio.rs index 29e1e0d..2317626 100644 --- a/src/hnswio.rs +++ b/src/hnswio.rs @@ -458,12 +458,13 @@ impl HnswIo { // for that we check for short names equality stripping log::debug!("distance in description = {:?}", distname); let d_type_name = type_name::().to_string(); - let v: Vec<&str> = d_type_name.rsplit_terminator("::").collect(); - for s in v { + let d_type_name_split: Vec<&str> = d_type_name.rsplit_terminator("::").collect(); + for s in &d_type_name_split { log::info!(" distname in generic type argument {:?}", s); } + let distname_split: Vec<&str> = distname.rsplit_terminator("::").collect(); if (std::any::TypeId::of::() != std::any::TypeId::of::()) - && (d_type_name != distname) + && (d_type_name_split[0] != distname_split[0]) { // for all types except NoData , distance asked in reload declaration and distance in dump must be equal! let mut errmsg = String::from("error in distances : dumped distance is : ");