about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2023-11-22 00:09:33 +0000
committerChris Denton <chris@chrisdenton.dev>2023-11-22 13:17:02 +0000
commit852c0383930a80c646441104a89af59f949c9804 (patch)
tree7416d70c6dfcb2b8e4c97425faea999eb303889f
parentc15adf6557a43b51bae72252b49c89635dbee325 (diff)
downloadrust-852c0383930a80c646441104a89af59f949c9804.tar.gz
rust-852c0383930a80c646441104a89af59f949c9804.zip
cmp_null
comparing with null is better expressed by the `.is_null()` method
-rw-r--r--library/std/src/sys/windows/time.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/windows/time.rs b/library/std/src/sys/windows/time.rs
index bece48e799f..09e78a29304 100644
--- a/library/std/src/sys/windows/time.rs
+++ b/library/std/src/sys/windows/time.rs
@@ -1,7 +1,7 @@
 use crate::cmp::Ordering;
 use crate::fmt;
 use crate::mem;
-use crate::ptr::{null, null_mut};
+use crate::ptr::null;
 use crate::sys::c;
 use crate::sys_common::IntoInner;
 use crate::time::Duration;
@@ -240,7 +240,7 @@ impl WaitableTimer {
                 c::TIMER_ALL_ACCESS,
             )
         };
-        if handle != null_mut() { Ok(Self { handle }) } else { Err(()) }
+        if !handle.is_null() { Ok(Self { handle }) } else { Err(()) }
     }
     pub fn set(&self, duration: Duration) -> Result<(), ()> {
         // Convert the Duration to a format similar to FILETIME.