File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,11 @@ impl Buf {
138138 self . inner . shrink_to ( min_capacity)
139139 }
140140
141+ #[ inline]
142+ pub fn leak < ' a > ( self ) -> & ' a mut Slice {
143+ Slice :: from_inner_mut ( self . inner . leak ( ) )
144+ }
145+
141146 #[ inline]
142147 pub fn into_box ( self ) -> Box < Slice > {
143148 unsafe { mem:: transmute ( self . inner . into_box ( ) ) }
Original file line number Diff line number Diff line change @@ -325,6 +325,11 @@ impl Wtf8Buf {
325325 self . bytes . shrink_to ( min_capacity)
326326 }
327327
328+ #[ inline]
329+ pub fn leak < ' a > ( self ) -> & ' a mut Wtf8 {
330+ unsafe { Wtf8 :: from_mut_bytes_unchecked ( self . bytes . leak ( ) ) }
331+ }
332+
328333 /// Returns the number of bytes that this string buffer can hold without reallocating.
329334 #[ inline]
330335 pub fn capacity ( & self ) -> usize {
You can’t perform that action at this time.
0 commit comments