We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
OsString::into_boxed_os_str
1 parent bda57db commit 6adbbfcCopy full SHA for 6adbbfc
src/libstd/ffi/os_str.rs
@@ -248,6 +248,18 @@ impl OsString {
248
}
249
250
/// Converts this `OsString` into a boxed `OsStr`.
251
+ ///
252
+ /// # Examples
253
254
+ /// ```
255
+ /// #![feature(into_boxed_os_str)]
256
257
+ /// use std::ffi::{OsString, OsStr};
258
259
+ /// let s = OsString::from("hello");
260
261
+ /// let b: Box<OsStr> = s.into_boxed_os_str();
262
263
#[unstable(feature = "into_boxed_os_str", issue = "0")]
264
pub fn into_boxed_os_str(self) -> Box<OsStr> {
265
unsafe { mem::transmute(self.inner.into_box()) }
0 commit comments