use notify::{RecursiveMode, Watcher};
use std::path::Path;
pub fn watch_file_path(path: Box<Path>) -> Result<(), crate::Error> {
let mut watcher = notify::recommended_watcher(|res| match res {
Ok(event) => println!("event: {:?}", event),
Err(e) => println!("watch error: {:?}", e),
})
.unwrap();
watcher.watch(&path, RecursiveMode::Recursive).unwrap();
Ok(())
}