Skip to content

Commit f8d5045

Browse files
committed
cargo fmt
1 parent c3f8565 commit f8d5045

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

src/apps/hnsw/partition/index.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ use neb::ram::cell::OwnedCell;
77
use std::{collections::BTreeMap, sync::Arc};
88

99
use super::{schema::*, HNSWIndexError};
10-
use crate::{apps::hnsw::measurements::HnswMetric, graph::GraphEngine, job::{logger::{append_job_log, JobLogLevel, JobLogger}, JobId}};
10+
use crate::{
11+
apps::hnsw::measurements::HnswMetric,
12+
graph::GraphEngine,
13+
job::{
14+
logger::{append_job_log, JobLogLevel, JobLogger},
15+
JobId,
16+
},
17+
};
1118
use dovahkiin::types::Map;
1219
pub struct HNSWIndex {
1320
pub id: Id,
@@ -75,8 +82,8 @@ impl HNSWIndex {
7582
JobLogLevel::Error,
7683
format!("Index not found: {:?}", cell_id),
7784
);
78-
return Ok(Err(HNSWIndexError::IndexNotFound))
79-
},
85+
return Ok(Err(HNSWIndexError::IndexNotFound));
86+
}
8087
Err(e) => return Ok(Err(HNSWIndexError::TxnError(e))),
8188
};
8289
let top_level = match cell[NUM_LEVELS].u32() {

src/apps/hnsw/partition/tests.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,18 @@ impl TestEnvironment {
182182
)
183183
.await
184184
.map_err(|e| format!("Failed to create index: {:?}", e))?;
185-
let indices = partition_svr.partition.indices.get(&(CELL_SCHEMA_ID, VECTOR_FIELD_ID)).unwrap();
185+
let indices = partition_svr
186+
.partition
187+
.indices
188+
.get(&(CELL_SCHEMA_ID, VECTOR_FIELD_ID))
189+
.unwrap();
186190
let index = indices.read().await;
187191
let index_cell = index_cell(&*index);
188-
self.neb_client.as_ref().unwrap().write_cell(index_cell).await
192+
self.neb_client
193+
.as_ref()
194+
.unwrap()
195+
.write_cell(index_cell)
196+
.await
189197
.map_err(|e| format!("Failed to write index cell: {:?}", e))?
190198
.map_err(|e| format!("Failed to write index cell: {:?}", e))?;
191199
Ok(())

0 commit comments

Comments
 (0)