- if new_list == state_guard.prev_list {
- // TODO: Hitting this a lot, is it true?
- println!("Interfaces seem to be the same, ignoring");
- return;
- }
- let update = Update {
- interfaces: new_list.0.clone(),
- diff: new_list.diff_from(&state_guard.prev_list),
- };
- (state_guard.cb)(update);
- state_guard.prev_list = new_list;
+ handle_notif(state_guard);
+ }
+}
+
+fn handle_notif(state: &mut WatchState) {
+ let Ok(new_list) = crate::list::list_interfaces() else {
+ return;
+ };
+ if new_list == state.prev_list {
+ return;