Skip to content

Commit

Permalink
Fix renames
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicHorrorDev committed Dec 21, 2023
1 parent de4db95 commit 87e25a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/file_watcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ impl DebounceEventHandler for MsgHandler {
let mut selected_event: Option<Event> = None;

// select the most interesting event
// Remove is more interesting than Modify
// Rename/Remove is more interesting than changing the contents
for ev in events {
match ev.event.kind {
EventKind::Modify(ModifyKind::Name(_)) | EventKind::Remove(_) => {
let _ = selected_event.insert(ev.event);
}
EventKind::Create(_) | EventKind::Modify(_) => {
let _ = selected_event.get_or_insert(ev.event);
}
EventKind::Remove(_) => {
let _ = selected_event.insert(ev.event);
}
_ => {}
}
}
Expand Down

0 comments on commit 87e25a8

Please sign in to comment.