Skip to content

Commit fe764af

Browse files
committed
fix: clippy
Signed-off-by: usamoi <[email protected]>
1 parent e05cfb8 commit fe764af

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/service/src/index/optimizing/indexing.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ impl<S: G> Seg<S> {
7676
}
7777
}
7878

79-
pub fn optimizing_indexing<S: G>(index: Arc<Index<S>>) -> Result<(), ()> {
79+
#[derive(Debug, thiserror::Error)]
80+
#[error("Interrupted, retry again.")]
81+
pub struct RetryError;
82+
83+
pub fn optimizing_indexing<S: G>(index: Arc<Index<S>>) -> Result<(), RetryError> {
8084
use Seg::*;
8185
let segs = {
8286
let protect = index.protect.lock();
@@ -100,7 +104,7 @@ pub fn optimizing_indexing<S: G>(index: Arc<Index<S>>) -> Result<(), ()> {
100104
}
101105
if segs_1.is_empty() || (segs_1.len() == 1 && count == 0) {
102106
index.instant_index.store(Instant::now());
103-
return Err(());
107+
return Err(RetryError);
104108
}
105109
segs_1
106110
};

0 commit comments

Comments
 (0)