File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
library/std/src/sys/windows Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ impl Handle {
107
107
unsafe { self . synchronous_read ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , Some ( offset) ) } ;
108
108
109
109
match res {
110
- Ok ( read) => Ok ( read as usize ) ,
110
+ Ok ( read) => Ok ( read) ,
111
111
Err ( ref e) if e. raw_os_error ( ) == Some ( c:: ERROR_HANDLE_EOF as i32 ) => Ok ( 0 ) ,
112
112
Err ( e) => Err ( e) ,
113
113
}
@@ -121,7 +121,7 @@ impl Handle {
121
121
Ok ( read) => {
122
122
// Safety: `read` bytes were written to the initialized portion of the buffer
123
123
unsafe {
124
- cursor. advance ( read as usize ) ;
124
+ cursor. advance ( read) ;
125
125
}
126
126
Ok ( ( ) )
127
127
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl<'a> IoSlice<'a> {
36
36
37
37
#[ inline]
38
38
pub fn as_slice ( & self ) -> & [ u8 ] {
39
- unsafe { slice:: from_raw_parts ( self . vec . buf as * mut u8 , self . vec . len as usize ) }
39
+ unsafe { slice:: from_raw_parts ( self . vec . buf , self . vec . len as usize ) }
40
40
}
41
41
}
42
42
@@ -70,12 +70,12 @@ impl<'a> IoSliceMut<'a> {
70
70
71
71
#[ inline]
72
72
pub fn as_slice ( & self ) -> & [ u8 ] {
73
- unsafe { slice:: from_raw_parts ( self . vec . buf as * mut u8 , self . vec . len as usize ) }
73
+ unsafe { slice:: from_raw_parts ( self . vec . buf , self . vec . len as usize ) }
74
74
}
75
75
76
76
#[ inline]
77
77
pub fn as_mut_slice ( & mut self ) -> & mut [ u8 ] {
78
- unsafe { slice:: from_raw_parts_mut ( self . vec . buf as * mut u8 , self . vec . len as usize ) }
78
+ unsafe { slice:: from_raw_parts_mut ( self . vec . buf , self . vec . len as usize ) }
79
79
}
80
80
}
81
81
Original file line number Diff line number Diff line change @@ -364,5 +364,5 @@ pub fn exit(code: i32) -> ! {
364
364
}
365
365
366
366
pub fn getpid ( ) -> u32 {
367
- unsafe { c:: GetCurrentProcessId ( ) as u32 }
367
+ unsafe { c:: GetCurrentProcessId ( ) }
368
368
}
Original file line number Diff line number Diff line change @@ -657,7 +657,7 @@ impl Process {
657
657
}
658
658
659
659
pub fn id ( & self ) -> u32 {
660
- unsafe { c:: GetProcessId ( self . handle . as_raw_handle ( ) ) as u32 }
660
+ unsafe { c:: GetProcessId ( self . handle . as_raw_handle ( ) ) }
661
661
}
662
662
663
663
pub fn main_thread_handle ( & self ) -> BorrowedHandle < ' _ > {
@@ -918,7 +918,7 @@ fn make_proc_thread_attribute_list(
918
918
} ;
919
919
920
920
let mut proc_thread_attribute_list = ProcThreadAttributeList (
921
- vec ! [ MaybeUninit :: uninit( ) ; required_size as usize ] . into_boxed_slice ( ) ,
921
+ vec ! [ MaybeUninit :: uninit( ) ; required_size] . into_boxed_slice ( ) ,
922
922
) ;
923
923
924
924
// Once we've allocated the necessary memory, it's safe to invoke
You can’t perform that action at this time.
0 commit comments