reformat with rustfmt 1.71

This commit is contained in:
Pascal Kuthe 2023-08-27 17:22:21 +02:00
parent b38fdfa8d7
commit 14014ed883
No known key found for this signature in database
GPG Key ID: D715E8655AE166A6
5 changed files with 16 additions and 11 deletions

View File

@ -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,
); );
}; };

View File

@ -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
}; };

View File

@ -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 }
}); });