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);
|
return Err(Error::NoConfigDirectory);
|
||||||
};
|
};
|
||||||
let user_path_clone = user_path.clone();
|
let user_path_clone = user_path.clone();
|
||||||
let mut watcher = notify::recommended_watcher(
|
let mut watcher =
|
||||||
move |event_res: Result<notify::Event, notify::Error>| {
|
notify::recommended_watcher(move |event_res: Result<notify::Event, notify::Error>| {
|
||||||
match event_res {
|
match event_res {
|
||||||
Ok(event) => {
|
Ok(event) => {
|
||||||
match &event.kind {
|
match &event.kind {
|
||||||
EventKind::Access(_)
|
EventKind::Access(_) | EventKind::Modify(ModifyKind::Metadata(_)) => {
|
||||||
| EventKind::Modify(ModifyKind::Metadata(_)) => {
|
|
||||||
// Data not mutated
|
// Data not mutated
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -294,8 +293,7 @@ impl Config {
|
||||||
//TODO: handle errors
|
//TODO: handle errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
})?;
|
||||||
)?;
|
|
||||||
watcher.watch(user_path, notify::RecursiveMode::Recursive)?;
|
watcher.watch(user_path, notify::RecursiveMode::Recursive)?;
|
||||||
Ok(watcher)
|
Ok(watcher)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,7 @@ use crate::{Config, CosmicConfigEntry};
|
||||||
|
|
||||||
pub enum ConfigState<T> {
|
pub enum ConfigState<T> {
|
||||||
Init(Cow<'static, str>, u64, bool),
|
Init(Cow<'static, str>, u64, bool),
|
||||||
Waiting(
|
Waiting(T, RecommendedWatcher, mpsc::Receiver<Vec<String>>, Config),
|
||||||
T,
|
|
||||||
RecommendedWatcher,
|
|
||||||
mpsc::Receiver<Vec<String>>,
|
|
||||||
Config,
|
|
||||||
),
|
|
||||||
Failed,
|
Failed,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue