allowing getting &mut OsStr from OsString
This commit is contained in:
parent
8e6de3244c
commit
ef2957de13
3 changed files with 31 additions and 0 deletions
|
@ -109,6 +109,11 @@ impl Buf {
|
|||
unsafe { mem::transmute(&*self.inner) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn as_mut_slice(&mut self) -> &mut Slice {
|
||||
unsafe { mem::transmute(&mut *self.inner) }
|
||||
}
|
||||
|
||||
pub fn into_string(self) -> Result<String, Buf> {
|
||||
String::from_utf8(self.inner).map_err(|p| Buf { inner: p.into_bytes() })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue