file watcher fix
@@ -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 {
