From eb3aa169123b675da6f0455eee0a753f2a27b46e Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Thu, 22 May 2025 22:58:24 -0400 Subject: [PATCH] Handle Any rename events --- libmarlin/src/watcher.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libmarlin/src/watcher.rs b/libmarlin/src/watcher.rs index 276a688..6681cae 100644 --- a/libmarlin/src/watcher.rs +++ b/libmarlin/src/watcher.rs @@ -270,8 +270,11 @@ impl FileWatcher { } // 2. native rename events from notify - EventKind::Modify(ModifyKind::Name(mode)) => match mode { - RenameMode::Both => { + EventKind::Modify(ModifyKind::Name(name_kind)) => match name_kind { + // Notify >= 6 emits `Both` when both paths are + // supplied and `Any` as a catch-all for renames. + // Treat both cases as a complete rename. + RenameMode::Both | RenameMode::Any => { if event.paths.len() >= 2 { let old_p = event.paths[0].clone(); let new_p = event.paths[1].clone(); @@ -333,6 +336,10 @@ impl FileWatcher { }); } } + // `From`/`To` are handled above. Any other + // value (`Other` or legacy `Rename`/`Move` + // variants) is treated as a normal modify + // event. _ => { for p in event.paths { debouncer.add_event(ProcessedEvent {