Skip to content

Commit

Permalink
fix small bug due to path change in distances name in reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-pierreBoth committed Apr 17, 2024
1 parent 5fb4519 commit 3b3c1ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hnswio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<D>().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::<T>() != std::any::TypeId::of::<NoData>())
&& (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 : ");
Expand Down

0 comments on commit 3b3c1ca

Please sign in to comment.