Skip to content

Commit

Permalink
More standard usage of From
Browse files Browse the repository at this point in the history
  • Loading branch information
jotare committed May 16, 2024
1 parent d5d9fdf commit fd08e42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nucliadb_node/src/shards/shard_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ impl ShardWriter {
run_with_telemetry(info_span!(parent: &span, "vector set_resource"), || {
debug!("Vector service starts set_resource");
let vectorset_resource = match vectorset.as_str() {
"" | DEFAULT_VECTORS_INDEX_NAME => nucliadb_core::vectors::ResourceWrapper::from(&resource),
"" | DEFAULT_VECTORS_INDEX_NAME => (&resource).into(),
vectorset => {
nucliadb_core::vectors::ResourceWrapper::new_vectorset_resource(&resource, vectorset)
}
Expand Down
6 changes: 3 additions & 3 deletions nucliadb_vectors/src/service/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ mod tests {
};
// insert - delete - insert sequence
let mut writer = VectorWriterService::create(vsc).unwrap();
writer.set_resource(nucliadb_core::vectors::ResourceWrapper::from(&resource)).unwrap();
writer.set_resource((&resource).into()).unwrap();

let reader = VectorReaderService::open(&shard_path).unwrap();
let mut request = VectorSearchRequest {
Expand Down Expand Up @@ -351,7 +351,7 @@ mod tests {
};
// insert - delete - insert sequence
let mut writer = VectorWriterService::create(vsc).unwrap();
let res = writer.set_resource(nucliadb_core::vectors::ResourceWrapper::from(&resource));
let res = writer.set_resource((&resource).into());
assert!(res.is_ok());
let reader = VectorReaderService::open(&shard_path).unwrap();
let request = VectorSearchRequest {
Expand Down Expand Up @@ -475,7 +475,7 @@ mod tests {
..Default::default()
};
let mut writer = VectorWriterService::create(vsc).unwrap();
let res = writer.set_resource(nucliadb_core::vectors::ResourceWrapper::from(&resource));
let res = writer.set_resource((&resource).into());
assert!(res.is_ok());
let reader = VectorReaderService::open(&shard_path).unwrap();
let request = VectorSearchRequest {
Expand Down

0 comments on commit fd08e42

Please sign in to comment.