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 {
138
138
self . inner . shrink_to ( min_capacity)
139
139
}
140
140
141
+ #[ inline]
142
+ pub fn leak < ' a > ( self ) -> & ' a mut Slice {
143
+ Slice :: from_inner_mut ( self . inner . leak ( ) )
144
+ }
145
+
141
146
#[ inline]
142
147
pub fn into_box ( self ) -> Box < Slice > {
143
148
unsafe { mem:: transmute ( self . inner . into_box ( ) ) }
Original file line number Diff line number Diff line change @@ -325,6 +325,11 @@ impl Wtf8Buf {
325
325
self . bytes . shrink_to ( min_capacity)
326
326
}
327
327
328
+ #[ inline]
329
+ pub fn leak < ' a > ( self ) -> & ' a mut Wtf8 {
330
+ unsafe { Wtf8 :: from_mut_bytes_unchecked ( self . bytes . leak ( ) ) }
331
+ }
332
+
328
333
/// Returns the number of bytes that this string buffer can hold without reallocating.
329
334
#[ inline]
330
335
pub fn capacity ( & self ) -> usize {
You can’t perform that action at this time.
0 commit comments