summaryrefslogtreecommitdiff
path: root/src/watch.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-25 14:44:12 +0200
committermo8it <mo8it@proton.me>2024-04-25 14:44:12 +0200
commit14fe248b4bfc3c577be7deacc346a959c7c0cc47 (patch)
tree2098c724c8538e080f1ac2132bf3c242c9643619 /src/watch.rs
parent88f27a53771a49a4e541627b84cc5dc7ab6f7357 (diff)
Optimize the notify event handler
Diffstat (limited to 'src/watch.rs')
-rw-r--r--src/watch.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/watch.rs b/src/watch.rs
index 1e22f59..2f4409a 100644
--- a/src/watch.rs
+++ b/src/watch.rs
@@ -42,19 +42,19 @@ pub enum WatchExit {
pub fn watch(
app_state: &mut AppState,
- notify_exercise_paths: Option<&'static [&'static str]>,
+ notify_exercise_names: Option<&'static [&'static [u8]]>,
) -> Result<WatchExit> {
let (tx, rx) = channel();
let mut manual_run = false;
// Prevent dropping the guard until the end of the function.
// Otherwise, the file watcher exits.
- let _debouncer_guard = if let Some(exercise_paths) = notify_exercise_paths {
+ let _debouncer_guard = if let Some(exercise_names) = notify_exercise_names {
let mut debouncer = new_debouncer(
Duration::from_millis(500),
DebounceEventHandler {
tx: tx.clone(),
- exercise_paths,
+ exercise_names,
},
)
.inspect_err(|_| eprintln!("{NOTIFY_ERR}"))?;