file watcher fix

This commit is contained in:
Dongdong Zhou 2022-05-16 13:49:09 +01:00
parent 716ce46fc4
commit 8878820030
1 changed files with 7 additions and 2 deletions

View File

@ -237,8 +237,13 @@ pub fn send_notification(&self, method: &str, params: Value) {
}
fn handle_fs_events(&self) {
let mut events =
{ self.file_watcher.lock().as_mut().unwrap().take_events() };
let mut events = {
self.file_watcher
.lock()
.as_mut()
.map(|w| w.take_events())
.unwrap_or_default()
};
for (token, event) in events.drain(..) {
match token {