diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2025-07-07 13:47:52 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2025-07-09 09:51:28 +0200 |
| commit | fd4384dd3f881af5aeec8931f4127cdbc6b6482f (patch) | |
| tree | 74eb1bebbf78df473ffb3c569533e826ec90ed82 | |
| parent | 84efededcba20661ede9219d715be866e46f9593 (diff) | |
| download | mullvadvpn-fd4384dd3f881af5aeec8931f4127cdbc6b6482f.tar.xz mullvadvpn-fd4384dd3f881af5aeec8931f4127cdbc6b6482f.zip | |
Use `std::ptr::eq` when comparing raw pointers
| -rw-r--r-- | talpid-core/src/split_tunnel/windows/path_monitor.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/talpid-core/src/split_tunnel/windows/path_monitor.rs b/talpid-core/src/split_tunnel/windows/path_monitor.rs index ad8d9ca1a3..ed537578b7 100644 --- a/talpid-core/src/split_tunnel/windows/path_monitor.rs +++ b/talpid-core/src/split_tunnel/windows/path_monitor.rs @@ -686,7 +686,7 @@ impl PathMonitor { return None; } for (i, dir_context) in self.dir_contexts.iter().enumerate() { - if (&*dir_context.overlapped as *const _) == overlapped { + if std::ptr::eq(&*dir_context.overlapped, overlapped) { return Some(i); } } @@ -700,7 +700,7 @@ impl PathMonitor { } let mut was_discarded = false; self.discarded_contexts.retain(|ctx| { - if ((&*ctx.overlapped) as *const _) != overlapped { + if !std::ptr::eq(&*ctx.overlapped, overlapped) { true } else { was_discarded = true; @@ -795,7 +795,7 @@ impl PathMonitor { result } }; - contexts.retain(|ctx| ((&*ctx.overlapped) as *const _) != result.used_overlapped); + contexts.retain(|ctx| !std::ptr::eq(&*ctx.overlapped, result.used_overlapped)); } } } |
