File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11use  alloc:: collections:: VecDeque ; 
2+ #[ cfg( feature = "std" ) ]  
3+ use  std:: io; 
24
35use  super :: Buf ; 
46
@@ -16,6 +18,22 @@ impl Buf for VecDeque<u8> {
1618        } 
1719    } 
1820
21+     #[ cfg( feature = "std" ) ]  
22+     fn  chunks_vectored < ' a > ( & ' a  self ,  dst :  & mut  [ io:: IoSlice < ' a > ] )  -> usize  { 
23+         if  self . is_empty ( )  || dst. is_empty ( )  { 
24+             return  0 ; 
25+         } 
26+ 
27+         let  ( s1,  s2)  = self . as_slices ( ) ; 
28+         dst[ 0 ]  = io:: IoSlice :: new ( s1) ; 
29+         if  s2. is_empty ( )  || dst. len ( )  == 1  { 
30+             return  1 ; 
31+         } 
32+ 
33+         dst[ 1 ]  = io:: IoSlice :: new ( s2) ; 
34+         2 
35+     } 
36+ 
1937    fn  advance ( & mut  self ,  cnt :  usize )  { 
2038        self . drain ( ..cnt) ; 
2139    } 
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ mod vec_deque {
353353        deque
354354    } 
355355
356-     buf_tests ! ( make_input,  /* `VecDeque` does not do `chucks_vectored */   false ) ; 
356+     buf_tests ! ( make_input,  true ) ; 
357357} 
358358
359359#[ cfg( feature = "std" ) ]  
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments