- let state_ptr = ctx as *const Mutex<WatchState>;
- unsafe {
- let state_guard = &mut *state_ptr.as_ref().unwrap().lock().unwrap();
- 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;