mirror of
https://github.com/solaeus/nucleo.git
synced 2024-12-22 09:57:49 +00:00
reformat with rustfmt 1.71
This commit is contained in:
parent
b38fdfa8d7
commit
14014ed883
@ -23,11 +23,7 @@ impl Matcher {
|
|||||||
// us to treat needle indices as u16
|
// us to treat needle indices as u16
|
||||||
let Some(mut matrix) = self.slab.alloc(&haystack[start..end], needle.len()) else {
|
let Some(mut matrix) = self.slab.alloc(&haystack[start..end], needle.len()) else {
|
||||||
return self.fuzzy_match_greedy_::<INDICES, H, N>(
|
return self.fuzzy_match_greedy_::<INDICES, H, N>(
|
||||||
haystack,
|
haystack, needle, start, greedy_end, indices,
|
||||||
needle,
|
|
||||||
start,
|
|
||||||
greedy_end,
|
|
||||||
indices,
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -278,7 +278,10 @@ impl<T: Sync + Send + 'static> Nucleo<T> {
|
|||||||
} else {
|
} else {
|
||||||
let Some(worker) = self.worker.try_lock_arc_for(Duration::from_millis(timeout)) else {
|
let Some(worker) = self.worker.try_lock_arc_for(Duration::from_millis(timeout)) else {
|
||||||
self.should_notify.store(true, Ordering::Release);
|
self.should_notify.store(true, Ordering::Release);
|
||||||
return Status{ changed: false, running: true };
|
return Status {
|
||||||
|
changed: false,
|
||||||
|
running: true,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
worker
|
worker
|
||||||
};
|
};
|
||||||
|
@ -102,14 +102,20 @@ impl<T: Sync + Send + 'static> Worker<T> {
|
|||||||
let Some(item) = item else {
|
let Some(item) = item else {
|
||||||
in_flight.lock().push(idx);
|
in_flight.lock().push(idx);
|
||||||
unmatched.fetch_add(1, atomic::Ordering::Relaxed);
|
unmatched.fetch_add(1, atomic::Ordering::Relaxed);
|
||||||
return Match { score: 0, idx: u32::MAX };
|
return Match {
|
||||||
|
score: 0,
|
||||||
|
idx: u32::MAX,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
if self.canceled.load(atomic::Ordering::Relaxed) {
|
if self.canceled.load(atomic::Ordering::Relaxed) {
|
||||||
return Match { score: 0, idx };
|
return Match { score: 0, idx };
|
||||||
}
|
}
|
||||||
let Some(score) = pattern.score(item.matcher_columns, matchers.get()) else {
|
let Some(score) = pattern.score(item.matcher_columns, matchers.get()) else {
|
||||||
unmatched.fetch_add(1, atomic::Ordering::Relaxed);
|
unmatched.fetch_add(1, atomic::Ordering::Relaxed);
|
||||||
return Match { score: 0, idx: u32::MAX };
|
return Match {
|
||||||
|
score: 0,
|
||||||
|
idx: u32::MAX,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
Match { score, idx }
|
Match { score, idx }
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user