File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11#![ forbid( unsafe_op_in_unsafe_fn) ]  
22
33use  super :: fd:: WasiFd ; 
4- use  crate :: io:: { self ,  IoSlice ,  IoSliceMut } ; 
4+ use  crate :: io:: { self ,  BorrowedCursor ,   IoSlice ,  IoSliceMut } ; 
55use  crate :: mem:: ManuallyDrop ; 
66use  crate :: os:: raw; 
77use  crate :: os:: wasi:: io:: { AsRawFd ,  FromRawFd } ; 
@@ -28,6 +28,10 @@ impl io::Read for Stdin {
2828        self . read_vectored ( & mut  [ IoSliceMut :: new ( data) ] ) 
2929    } 
3030
31+     fn  read_buf ( & mut  self ,  buf :  BorrowedCursor < ' _ > )  -> io:: Result < ( ) >  { 
32+         ManuallyDrop :: new ( unsafe  {  WasiFd :: from_raw_fd ( self . as_raw_fd ( ) )  } ) . read_buf ( buf) 
33+     } 
34+ 
3135    fn  read_vectored ( & mut  self ,  data :  & mut  [ IoSliceMut < ' _ > ] )  -> io:: Result < usize >  { 
3236        ManuallyDrop :: new ( unsafe  {  WasiFd :: from_raw_fd ( self . as_raw_fd ( ) )  } ) . read ( data) 
3337    } 
@@ -64,6 +68,7 @@ impl io::Write for Stdout {
6468    fn  is_write_vectored ( & self )  -> bool  { 
6569        true 
6670    } 
71+ 
6772    fn  flush ( & mut  self )  -> io:: Result < ( ) >  { 
6873        Ok ( ( ) ) 
6974    } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments