]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/unix/ext.rs
Stabilize `std::convert` and related code
[rust.git] / src / libstd / sys / unix / ext.rs
index 0805949d5602193272bfdce4d0a5933cf4b357ae..d197d04c0a4c483a7cb3818dd76cdf980850c9c7 100644 (file)
@@ -138,7 +138,7 @@ fn as_raw_fd(&self) -> Fd { *self.as_inner().socket().as_inner() }
 /// Unix-specific extension to the primitives in the `std::ffi` module
 #[stable(feature = "rust1", since = "1.0.0")]
 pub mod ffi {
-    use ffi::{CString, NulError, OsStr, OsString};
+    use ffi::{OsStr, OsString};
     use mem;
     use prelude::v1::*;
     use sys::os_str::Buf;
@@ -175,10 +175,6 @@ pub trait OsStrExt {
         /// Get the underlying byte view of the `OsStr` slice.
         #[stable(feature = "rust1", since = "1.0.0")]
         fn as_bytes(&self) -> &[u8];
-
-        /// Convert the `OsStr` slice into a `CString`.
-        #[stable(feature = "rust1", since = "1.0.0")]
-        fn to_cstring(&self) -> Result<CString, NulError>;
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -189,9 +185,6 @@ fn from_bytes(slice: &[u8]) -> &OsStr {
         fn as_bytes(&self) -> &[u8] {
             &self.as_inner().inner
         }
-        fn to_cstring(&self) -> Result<CString, NulError> {
-            CString::new(self.as_bytes())
-        }
     }
 }