diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ffi/os_str.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 9da6eca3408..b0f79f9a395 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -248,6 +248,18 @@ impl OsString { } /// Converts this `OsString` into a boxed `OsStr`. + /// + /// # Examples + /// + /// ``` + /// #![feature(into_boxed_os_str)] + /// + /// use std::ffi::{OsString, OsStr}; + /// + /// let s = OsString::from("hello"); + /// + /// let b: Box<OsStr> = s.into_boxed_os_str(); + /// ``` #[unstable(feature = "into_boxed_os_str", issue = "0")] pub fn into_boxed_os_str(self) -> Box<OsStr> { unsafe { mem::transmute(self.inner.into_box()) } |
