Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/hnsw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl HnswIndex {
}

/// Load index from memory buffers
pub fn load_from_hnsw_data(config: HnswIndexMemoryLoadConfig, load_data: HnswData) -> Result<Self, HnswInitError> {
pub fn load_from_hnsw_data(config: HnswIndexMemoryLoadConfig, load_data: &HnswData) -> Result<Self, HnswInitError> {
let distance_function_string: String = config.distance_function.into();
let space_name = CString::new(distance_function_string)
.map_err(|e| HnswInitError::InvalidDistanceFunction(e.to_string()))?;
Expand Down Expand Up @@ -949,7 +949,7 @@ pub mod test {
distance_function,
dimensionality: d as i32,
ef_search: 100,
}, hnsw_data.expect("Failed to create HnswData"));
}, &hnsw_data.expect("Failed to create HnswData"));

let index = match index {
Err(e) => panic!("Error loading index: {}", e),
Expand Down Expand Up @@ -1021,7 +1021,7 @@ pub mod test {
dimensionality: d as i32,
ef_search: 100,
},
hnsw_data,
&hnsw_data,
).expect("Failed to load from memory buffers");

// Verify loaded index has same data
Expand Down