File tree Expand file tree Collapse file tree 5 files changed +25
-0
lines changed Expand file tree Collapse file tree 5 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ impl OsString {
205205        self . inner . reserve_exact ( additional) 
206206    } 
207207
208+     /// Shrinks the capacity of the `OsString` to match its length. 
209+ #[ unstable( feature = "osstring_shrink_to_fit" ,  issue = "40421" ) ]  
210+     pub  fn  shrink_to_fit ( & mut  self )  { 
211+         self . inner . shrink_to_fit ( ) 
212+     } 
213+ 
208214    /// Converts this `OsString` into a boxed `OsStr`. 
209215#[ unstable( feature = "into_boxed_os_str" ,  issue = "0" ) ]  
210216    pub  fn  into_boxed_os_str ( self )  -> Box < OsStr >  { 
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ impl Buf {
8383        self . inner . reserve_exact ( additional) 
8484    } 
8585
86+     #[ inline]  
87+     pub  fn  shrink_to_fit ( & mut  self )  { 
88+         self . inner . shrink_to_fit ( ) 
89+     } 
90+ 
8691    pub  fn  as_slice ( & self )  -> & Slice  { 
8792        unsafe  {  mem:: transmute ( & * self . inner )  } 
8893    } 
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ impl Buf {
8383        self . inner . reserve_exact ( additional) 
8484    } 
8585
86+     #[ inline]  
87+     pub  fn  shrink_to_fit ( & mut  self )  { 
88+         self . inner . shrink_to_fit ( ) 
89+     } 
90+ 
8691    pub  fn  as_slice ( & self )  -> & Slice  { 
8792        unsafe  {  mem:: transmute ( & * self . inner )  } 
8893    } 
Original file line number Diff line number Diff line change @@ -89,6 +89,10 @@ impl Buf {
8989        self . inner . reserve_exact ( additional) 
9090    } 
9191
92+     pub  fn  shrink_to_fit ( & mut  self )  { 
93+         self . inner . shrink_to_fit ( ) 
94+     } 
95+ 
9296    #[ inline]  
9397    pub  fn  into_box ( self )  -> Box < Slice >  { 
9498        unsafe  {  mem:: transmute ( self . inner . into_box ( ) )  } 
Original file line number Diff line number Diff line change @@ -236,6 +236,11 @@ impl Wtf8Buf {
236236        self . bytes . reserve_exact ( additional) 
237237    } 
238238
239+     #[ inline]  
240+     pub  fn  shrink_to_fit ( & mut  self )  { 
241+         self . bytes . shrink_to_fit ( ) 
242+     } 
243+ 
239244    /// Returns the number of bytes that this string buffer can hold without reallocating. 
240245#[ inline]  
241246    pub  fn  capacity ( & self )  -> usize  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments