Skip to content

Commit

Permalink
cmp_null
Browse files Browse the repository at this point in the history
comparing with null is better expressed by the `.is_null()` method
  • Loading branch information
ChrisDenton committed Nov 22, 2023
1 parent ff39844 commit 2f1298a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/sys/windows/time.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2f1298a

Please sign in to comment.