diff --git a/yazi-core/src/mgr/watcher.rs b/yazi-core/src/mgr/watcher.rs index a7475387..b0814eb7 100644 --- a/yazi-core/src/mgr/watcher.rs +++ b/yazi-core/src/mgr/watcher.rs @@ -43,10 +43,9 @@ impl Watcher { } #[cfg(any(target_os = "linux", target_os = "macos"))] - yazi_fs::mounts::Partitions::monitor( - yazi_fs::mounts::PARTITIONS.clone(), - yazi_dds::Pubsub::pub_from_mount, - ); + yazi_fs::mounts::Partitions::monitor(yazi_fs::mounts::PARTITIONS.clone(), || { + yazi_macro::err!(yazi_dds::Pubsub::pub_from_mount()) + }); tokio::spawn(Self::fan_out(out_rx)); Self { in_tx, out_tx } diff --git a/yazi-fs/src/mounts/macos.rs b/yazi-fs/src/mounts/macos.rs index b7e7e80a..82dcebd5 100644 --- a/yazi-fs/src/mounts/macos.rs +++ b/yazi-fs/src/mounts/macos.rs @@ -12,7 +12,10 @@ use yazi_shared::natsort; use super::{Locked, Partition, Partitions}; impl Partitions { - pub fn monitor(me: Locked, cb: fn() -> Result<()>) { + pub fn monitor(me: Locked, cb: F) + where + F: Fn() + Copy + Send + 'static, + { tokio::task::spawn_blocking(move || { let session = unsafe { DASessionCreate(kCFAllocatorDefault) }; if session.is_null() {