Skip to content

Commit 852c038

Browse files
committed
cmp_null
comparing with null is better expressed by the `.is_null()` method
1 parent c15adf6 commit 852c038

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: library/std/src/sys/windows/time.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::cmp::Ordering;
22
use crate::fmt;
33
use crate::mem;
4-
use crate::ptr::{null, null_mut};
4+
use crate::ptr::null;
55
use crate::sys::c;
66
use crate::sys_common::IntoInner;
77
use crate::time::Duration;
@@ -240,7 +240,7 @@ impl WaitableTimer {
240240
c::TIMER_ALL_ACCESS,
241241
)
242242
};
243-
if handle != null_mut() { Ok(Self { handle }) } else { Err(()) }
243+
if !handle.is_null() { Ok(Self { handle }) } else { Err(()) }
244244
}
245245
pub fn set(&self, duration: Duration) -> Result<(), ()> {
246246
// Convert the Duration to a format similar to FILETIME.

0 commit comments

Comments
 (0)