We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c165d4 commit e33695dCopy full SHA for e33695d
library/std/src/sys/os_str/wtf8.rs
@@ -138,6 +138,11 @@ impl Buf {
138
self.inner.shrink_to(min_capacity)
139
}
140
141
+ #[inline]
142
+ pub fn leak<'a>(self) -> &'a mut Slice {
143
+ Slice::from_inner_mut(self.inner.leak())
144
+ }
145
+
146
#[inline]
147
pub fn into_box(self) -> Box<Slice> {
148
unsafe { mem::transmute(self.inner.into_box()) }
library/std/src/sys_common/wtf8.rs
@@ -325,6 +325,11 @@ impl Wtf8Buf {
325
self.bytes.shrink_to(min_capacity)
326
327
328
329
+ pub fn leak<'a>(self) -> &'a mut Wtf8 {
330
+ unsafe { Wtf8::from_mut_bytes_unchecked(self.bytes.leak()) }
331
332
333
/// Returns the number of bytes that this string buffer can hold without reallocating.
334
335
pub fn capacity(&self) -> usize {
0 commit comments