Skip to content

Commit

Permalink
Fix file watcher panic if event has no paths
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Nov 15, 2024
1 parent 2b58705 commit 2685278
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/red_knot_workspace/src/watch/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,16 @@ impl Debouncer {
return;
}

let Some(path) = event.paths.into_iter().next() else {
tracing::debug!(
"Ignoring change event with kind '{:?}' without a path.",
event.kind
);
return;
};

let kind = event.kind;
let path = match SystemPathBuf::from_path_buf(event.paths.into_iter().next().unwrap()) {
let path = match SystemPathBuf::from_path_buf(path) {
Ok(path) => path,
Err(path) => {
tracing::debug!(
Expand Down

0 comments on commit 2685278

Please sign in to comment.