File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
library/std/src/sys/windows Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ impl Handle {
8181 let res = unsafe { self . synchronous_read ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , None ) } ;
8282
8383 match res {
84- Ok ( read) => Ok ( read as usize ) ,
84+ Ok ( read) => Ok ( read) ,
8585
8686 // The special treatment of BrokenPipe is to deal with Windows
8787 // pipe semantics, which yields this error when *reading* from
@@ -107,7 +107,7 @@ impl Handle {
107107 unsafe { self . synchronous_read ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , Some ( offset) ) } ;
108108
109109 match res {
110- Ok ( read) => Ok ( read as usize ) ,
110+ Ok ( read) => Ok ( read) ,
111111 Err ( ref e) if e. raw_os_error ( ) == Some ( c:: ERROR_HANDLE_EOF as i32 ) => Ok ( 0 ) ,
112112 Err ( e) => Err ( e) ,
113113 }
@@ -121,7 +121,7 @@ impl Handle {
121121 Ok ( read) => {
122122 // Safety: `read` bytes were written to the initialized portion of the buffer
123123 unsafe {
124- cursor. advance ( read as usize ) ;
124+ cursor. advance ( read) ;
125125 }
126126 Ok ( ( ) )
127127 }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl<'a> IoSlice<'a> {
3636
3737 #[ inline]
3838 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 ) }
4040 }
4141}
4242
@@ -70,12 +70,12 @@ impl<'a> IoSliceMut<'a> {
7070
7171 #[ inline]
7272 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 ) }
7474 }
7575
7676 #[ inline]
7777 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 ) }
7979 }
8080}
8181
Original file line number Diff line number Diff line change @@ -364,5 +364,5 @@ pub fn exit(code: i32) -> ! {
364364}
365365
366366pub fn getpid ( ) -> u32 {
367- unsafe { c:: GetCurrentProcessId ( ) as u32 }
367+ unsafe { c:: GetCurrentProcessId ( ) }
368368}
Original file line number Diff line number Diff line change @@ -657,7 +657,7 @@ impl Process {
657657 }
658658
659659 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 ( ) ) }
661661 }
662662
663663 pub fn main_thread_handle ( & self ) -> BorrowedHandle < ' _ > {
@@ -918,7 +918,7 @@ fn make_proc_thread_attribute_list(
918918 } ;
919919
920920 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 ( ) ,
922922 ) ;
923923
924924 // Once we've allocated the necessary memory, it's safe to invoke
You can’t perform that action at this time.
0 commit comments