X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/244781f32194c2498ef0e3b8225a9ff9791624af..f9df7170ac929ccc915642c2e6415e768973bb54:/src/watch_win.rs diff --git a/src/watch_win.rs b/src/watch_win.rs index a225f4a..23b274e 100644 --- a/src/watch_win.rs +++ b/src/watch_win.rs @@ -23,7 +23,7 @@ struct WatchState { /// The last result that we captured, for diffing prev_list: List, /// User's callback - cb: Box, + cb: Box, } pub(crate) struct WatchHandle { @@ -39,7 +39,7 @@ impl Drop for WatchHandle { } } -pub(crate) fn watch_interfaces( +pub(crate) fn watch_interfaces( callback: F, ) -> Result { let state = Box::pin(Mutex::new(WatchState { @@ -81,7 +81,8 @@ unsafe extern "system" fn notif( ) { let state_ptr = ctx as *const Mutex; unsafe { - let state_guard = &mut *state_ptr.as_ref() + let state_guard = &mut *state_ptr + .as_ref() .expect("callback ctx should never be null") .lock() .unwrap();