cmp_null
comparing with null is better expressed by the `.is_null()` method
This commit is contained in:
parent
c15adf6557
commit
852c038393
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue