cargo fmt
This commit is contained in:
parent
7fb514bfac
commit
7555d9dfd1
2 changed files with 5 additions and 12 deletions
|
|
@ -256,13 +256,12 @@ impl Config {
|
|||
return Err(Error::NoConfigDirectory);
|
||||
};
|
||||
let user_path_clone = user_path.clone();
|
||||
let mut watcher = notify::recommended_watcher(
|
||||
move |event_res: Result<notify::Event, notify::Error>| {
|
||||
let mut watcher =
|
||||
notify::recommended_watcher(move |event_res: Result<notify::Event, notify::Error>| {
|
||||
match event_res {
|
||||
Ok(event) => {
|
||||
match &event.kind {
|
||||
EventKind::Access(_)
|
||||
| EventKind::Modify(ModifyKind::Metadata(_)) => {
|
||||
EventKind::Access(_) | EventKind::Modify(ModifyKind::Metadata(_)) => {
|
||||
// Data not mutated
|
||||
return;
|
||||
}
|
||||
|
|
@ -294,8 +293,7 @@ impl Config {
|
|||
//TODO: handle errors
|
||||
}
|
||||
}
|
||||
},
|
||||
)?;
|
||||
})?;
|
||||
watcher.watch(user_path, notify::RecursiveMode::Recursive)?;
|
||||
Ok(watcher)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,7 @@ use crate::{Config, CosmicConfigEntry};
|
|||
|
||||
pub enum ConfigState<T> {
|
||||
Init(Cow<'static, str>, u64, bool),
|
||||
Waiting(
|
||||
T,
|
||||
RecommendedWatcher,
|
||||
mpsc::Receiver<Vec<String>>,
|
||||
Config,
|
||||
),
|
||||
Waiting(T, RecommendedWatcher, mpsc::Receiver<Vec<String>>, Config),
|
||||
Failed,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue