diff options
| author | David Lönnhager <david.l@mullvad.net> | 2023-09-08 16:06:01 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2023-09-11 16:34:41 +0200 |
| commit | a05d767ac2d0977850351e594f5c1630e877c4c7 (patch) | |
| tree | 6b30b44763d5bff18e1f24af81df94bc465374d8 | |
| parent | 986e0c4ffef1beafb65f765650ad78f9e51dd1b1 (diff) | |
| download | mullvadvpn-a05d767ac2d0977850351e594f5c1630e877c4c7.tar.xz mullvadvpn-a05d767ac2d0977850351e594f5c1630e877c4c7.zip | |
Fix warnings about static_resolv_conf
| -rw-r--r-- | talpid-core/src/dns/linux/static_resolv_conf.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/talpid-core/src/dns/linux/static_resolv_conf.rs b/talpid-core/src/dns/linux/static_resolv_conf.rs index 674fc077c5..b1f28f5f52 100644 --- a/talpid-core/src/dns/linux/static_resolv_conf.rs +++ b/talpid-core/src/dns/linux/static_resolv_conf.rs @@ -113,7 +113,7 @@ impl Drop for DnsWatcher { impl DnsWatcher { fn start(state: Arc<Mutex<Option<State>>>) -> Result<Self> { - let mut watcher = Inotify::init().map_err(Error::WatchResolvConf)?; + let watcher = Inotify::init().map_err(Error::WatchResolvConf)?; let mut mask = WatchMask::empty(); // Documentation for the meaning of these masks can be found in `man inotify` // @@ -125,7 +125,8 @@ impl DnsWatcher { mask.insert(WatchMask::MOVE_SELF); watcher - .add_watch(RESOLV_CONF_PATH, mask) + .watches() + .add(RESOLV_CONF_PATH, mask) .map_err(Error::WatchResolvConf)?; let (cancel_trigger, cancel_listener) = trigger(); @@ -136,14 +137,14 @@ impl DnsWatcher { } async fn event_loop( - mut watcher: Inotify, + watcher: Inotify, mut cancel_listener: Listener, state: &Arc<Mutex<Option<State>>>, ) { const EVENT_BUFFER_SIZE: usize = 1024; let mut buffer = [0; EVENT_BUFFER_SIZE]; let mut events = watcher - .event_stream(&mut buffer) + .into_event_stream(&mut buffer) .expect("Could not read events for resolv.conf"); loop { |
