aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-nucleo/src/worker.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2026-03-16 15:49:54 -0700
committerEllie Huxtable <ellie@elliehuxtable.com>2026-03-16 16:18:41 -0700
commit0f67f59e585836145e436310caabb338b12062a7 (patch)
tree2f957419d1c84024b25c6525da3ea92897d7ecd4 /crates/atuin-nucleo/src/worker.rs
parentfeat: Add custom filtering and scoring mechanisms (diff)
downloadatuin-0f67f59e585836145e436310caabb338b12062a7.zip
vendor nucleo fork into atuin workspace
Rename crates (nucleo → atuin-nucleo, nucleo-matcher → atuin-nucleo-matcher), add to workspace members and dependencies, update all import paths, remove vendored CI workflow, and suppress upstream clippy warnings. format codespell fixes clippy clappy
Diffstat (limited to 'crates/atuin-nucleo/src/worker.rs')
-rw-r--r--crates/atuin-nucleo/src/worker.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/atuin-nucleo/src/worker.rs b/crates/atuin-nucleo/src/worker.rs
index ddd546ad..45e27cee 100644
--- a/crates/atuin-nucleo/src/worker.rs
+++ b/crates/atuin-nucleo/src/worker.rs
@@ -3,7 +3,7 @@ use std::mem::take;
use std::sync::atomic::{self, AtomicBool, AtomicU32};
use std::sync::Arc;
-use nucleo_matcher::Config;
+use atuin_nucleo_matcher::Config;
use parking_lot::Mutex;
use rayon::{prelude::*, ThreadPool};
@@ -11,12 +11,12 @@ use crate::par_sort::par_quicksort;
use crate::pattern::{self, MultiPattern};
use crate::{boxcar, Filter, Match, Scorer};
-struct Matchers(Box<[UnsafeCell<nucleo_matcher::Matcher>]>);
+struct Matchers(Box<[UnsafeCell<atuin_nucleo_matcher::Matcher>]>);
impl Matchers {
// this is not a true mut from ref, we use a cell here
#[allow(clippy::mut_from_ref)]
- unsafe fn get(&self) -> &mut nucleo_matcher::Matcher {
+ unsafe fn get(&self) -> &mut atuin_nucleo_matcher::Matcher {
&mut *self.0[rayon::current_thread_index().unwrap()].get()
}
}
@@ -35,7 +35,7 @@ pub(crate) struct Worker<T: Sync + Send + 'static> {
pub(crate) should_notify: Arc<AtomicBool>,
pub(crate) was_canceled: bool,
pub(crate) last_snapshot: u32,
- notify: Arc<(dyn Fn() + Sync + Send)>,
+ notify: Arc<dyn Fn() + Sync + Send>,
pub(crate) items: Arc<boxcar::Vec<T>>,
in_flight: Vec<u32>,
pub(crate) filter: Option<Filter<T>>,
@@ -69,7 +69,7 @@ impl<T: Sync + Send + 'static> Worker<T> {
pub(crate) fn new(
worker_threads: Option<usize>,
config: Config,
- notify: Arc<(dyn Fn() + Sync + Send)>,
+ notify: Arc<dyn Fn() + Sync + Send>,
cols: u32,
) -> (ThreadPool, Self) {
let worker_threads = worker_threads
@@ -80,7 +80,7 @@ impl<T: Sync + Send + 'static> Worker<T> {
.build()
.expect("creating threadpool failed");
let matchers = (0..worker_threads)
- .map(|_| UnsafeCell::new(nucleo_matcher::Matcher::new(config.clone())))
+ .map(|_| UnsafeCell::new(atuin_nucleo_matcher::Matcher::new(config.clone())))
.collect();
let worker = Worker {
running: false,