File tree 3 files changed +6
-6
lines changed
Filter options
3 files changed +6
-6
lines changed
Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ pub mod windows {
320
320
. get_or_init ( || {
321
321
let library_name = OsString :: from ( "api-ms-win-core-file-l2-1-4" ) . to_wide_with_nul ( ) ;
322
322
let module = unsafe { LoadLibraryW ( library_name. as_ptr ( ) ) } ;
323
- if module == std :: ptr :: null_mut ( ) {
323
+ if module. is_null ( ) {
324
324
return None ;
325
325
}
326
326
let name = CString :: new ( "GetFileInformationByName" ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ mod _overlapped {
130
130
131
131
fn mark_as_completed ( ov : & mut OVERLAPPED ) {
132
132
ov. Internal = 0 ;
133
- if ov. hEvent != std :: ptr :: null_mut ( ) {
133
+ if ! ov. hEvent . is_null ( ) {
134
134
unsafe { windows_sys:: Win32 :: System :: Threading :: SetEvent ( ov. hEvent ) } ;
135
135
}
136
136
}
@@ -263,7 +263,7 @@ mod _overlapped {
263
263
type Args = ( isize , ) ;
264
264
265
265
fn py_new ( cls : PyTypeRef , ( mut event, ) : Self :: Args , vm : & VirtualMachine ) -> PyResult {
266
- if event as isize == INVALID_HANDLE_VALUE as isize {
266
+ if event == INVALID_HANDLE_VALUE ( vm ) {
267
267
event = unsafe {
268
268
windows_sys:: Win32 :: System :: Threading :: CreateEventA (
269
269
std:: ptr:: null ( ) ,
@@ -272,7 +272,7 @@ mod _overlapped {
272
272
std:: ptr:: null ( ) ,
273
273
) as isize
274
274
} ;
275
- if event as isize == NULL {
275
+ if event == NULL {
276
276
return Err ( errno_err ( vm) ) ;
277
277
}
278
278
}
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ pub(crate) mod module {
150
150
}
151
151
152
152
let h = unsafe { Threading :: OpenProcess ( Threading :: PROCESS_ALL_ACCESS , 0 , pid) } ;
153
- if h == std :: ptr :: null_mut ( ) {
153
+ if h. is_null ( ) {
154
154
return Err ( errno_err ( vm) ) ;
155
155
}
156
156
let ret = unsafe { Threading :: TerminateProcess ( h, sig) } ;
@@ -172,7 +172,7 @@ pub(crate) mod module {
172
172
_ => return Err ( vm. new_value_error ( "bad file descriptor" . to_owned ( ) ) ) ,
173
173
} ;
174
174
let h = unsafe { Console :: GetStdHandle ( stdhandle) } ;
175
- if h == std :: ptr :: null_mut ( ) {
175
+ if h. is_null ( ) {
176
176
return Err ( vm. new_os_error ( "handle cannot be retrieved" . to_owned ( ) ) ) ;
177
177
}
178
178
if h == INVALID_HANDLE_VALUE {
You can’t perform that action at this time.
0 commit comments