mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
624eb4fb25
commit
054b93db56
2 changed files with 7 additions and 5 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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<F>(me: Locked, cb: F)
|
||||
where
|
||||
F: Fn() + Copy + Send + 'static,
|
||||
{
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let session = unsafe { DASessionCreate(kCFAllocatorDefault) };
|
||||
if session.is_null() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue