]> code.octet-stream.net Git - netwatcher/blobdiff - src/watch_win.rs
Don't include "down" interfaces on Windows
[netwatcher] / src / watch_win.rs
index 67e0d4c88fc27d3216a5760a2d7ddc13afb294bb..41612b8ae5f51d979fcf99f697ae30646766401b 100644 (file)
@@ -19,14 +19,14 @@ use crate::Error;
 use crate::List;
 use crate::Update;
 
-pub struct WatchState {
+struct WatchState {
     /// The last result that we captured, for diffing
     prev_list: List,
     /// User's callback
     cb: Box<dyn FnMut(Update) + 'static>,
 }
 
-pub struct WatchHandle {
+pub(crate) struct WatchHandle {
     hnd: HANDLE,
     _state: Pin<Box<Mutex<WatchState>>>,
 }
@@ -63,7 +63,7 @@ pub(crate) fn watch_interfaces<F: FnMut(Update) + 'static>(
             // Trigger an initial update.
             // This is allowed to race with true updates because it
             // will always calculate a diff and discard no-ops.
-            handle_notif(&mut *state.lock().unwrap());
+            handle_notif(&mut state.lock().unwrap());
             // Then return the handle
             Ok(WatchHandle { hnd, _state: state })
         }