]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/path.rs
Rollup merge of #24649 - nham:path_new_examples, r=steveklabnik
[rust.git] / src / libstd / path.rs
index 0a13c77018f71e598ad5f8b660c5e6523f750fab..a52a3dbbef9a5f75956e914cd55e9cb7cce05147 100644 (file)
 use ascii::*;
 use borrow::{Borrow, IntoCow, ToOwned, Cow};
 use cmp;
-use iter::{self, IntoIterator};
+use iter;
 use mem;
 use ops::{self, Deref};
 use string::String;
 use vec::Vec;
 use fmt;
 
-use ffi::{OsStr, OsString, AsOsStr};
+use ffi::{OsStr, OsString};
 
 use self::platform::{is_sep_byte, is_verbatim_sep, MAIN_SEP_STR, parse_prefix};
 
@@ -1184,14 +1184,6 @@ fn as_ref(&self) -> &OsStr {
     }
 }
 
-#[stable(feature = "rust1", since = "1.0.0")]
-#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
-impl AsOsStr for PathBuf {
-    fn as_os_str(&self) -> &OsStr {
-        &self.inner[..]
-    }
-}
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Into<OsString> for PathBuf {
     fn into(self) -> OsString {
@@ -1660,14 +1652,6 @@ fn as_ref(&self) -> &OsStr {
     }
 }
 
-#[stable(feature = "rust1", since = "1.0.0")]
-#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
-impl AsOsStr for Path {
-    fn as_os_str(&self) -> &OsStr {
-        &self.inner
-    }
-}
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl fmt::Debug for Path {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
@@ -1719,22 +1703,6 @@ fn cmp(&self, other: &Path) -> cmp::Ordering {
     }
 }
 
-/// Freely convertible to a `Path`.
-#[unstable(feature = "std_misc")]
-#[deprecated(since = "1.0.0", reason = "use std::convert::AsRef<Path> instead")]
-pub trait AsPath {
-    /// Converts to a `Path`.
-    #[unstable(feature = "std_misc")]
-    fn as_path(&self) -> &Path;
-}
-
-#[unstable(feature = "std_misc")]
-#[deprecated(since = "1.0.0", reason = "use std::convert::AsRef<Path> instead")]
-#[allow(deprecated)]
-impl<T: AsOsStr + ?Sized> AsPath for T {
-    fn as_path(&self) -> &Path { Path::new(self.as_os_str()) }
-}
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl AsRef<Path> for Path {
     fn as_ref(&self) -> &Path { self }