Better variable naming

This commit is contained in:
mo8it 2024-05-13 16:44:48 +02:00
parent a7bc6d53a5
commit 17a2d42ffd

View file

@ -9,17 +9,17 @@ pub struct DebounceEventHandler {
} }
impl notify_debouncer_mini::DebounceEventHandler for DebounceEventHandler { impl notify_debouncer_mini::DebounceEventHandler for DebounceEventHandler {
fn handle_event(&mut self, event: DebounceEventResult) { fn handle_event(&mut self, input_event: DebounceEventResult) {
let event = match event { let output_event = match input_event {
Ok(event) => { Ok(input_event) => {
let Some(exercise_ind) = event let Some(exercise_ind) = input_event
.iter() .iter()
.filter_map(|event| { .filter_map(|input_event| {
if event.kind != DebouncedEventKind::Any { if input_event.kind != DebouncedEventKind::Any {
return None; return None;
} }
let file_name = event.path.file_name()?.to_str()?.as_bytes(); let file_name = input_event.path.file_name()?.to_str()?.as_bytes();
if file_name.len() < 4 { if file_name.len() < 4 {
return None; return None;
@ -46,6 +46,6 @@ impl notify_debouncer_mini::DebounceEventHandler for DebounceEventHandler {
// An error occurs when the receiver is dropped. // An error occurs when the receiver is dropped.
// After dropping the receiver, the debouncer guard should also be dropped. // After dropping the receiver, the debouncer guard should also be dropped.
let _ = self.tx.send(event); let _ = self.tx.send(output_event);
} }
} }