fix: Don't assert paths being utf8 when filtering them in the watcher

This commit is contained in:
Lukas Wirth 2024-03-22 08:04:50 +01:00
parent fe28e470cd
commit ea447062c4
3 changed files with 14 additions and 8 deletions

View file

@ -13,7 +13,7 @@ use std::fs;
use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher};
use paths::{AbsPath, AbsPathBuf, Utf8Path};
use paths::{AbsPath, AbsPathBuf};
use vfs::loader;
use walkdir::WalkDir;
@ -205,7 +205,7 @@ impl NotifyActor {
if !entry.file_type().is_dir() {
return true;
}
let path = AbsPath::assert(Utf8Path::from_path(entry.path()).unwrap());
let path = entry.path();
root == path
|| dirs.exclude.iter().chain(&dirs.include).all(|it| it != path)
});