Skip to content

Commit

Permalink
std: Remove deprecated AsPath trait
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Apr 21, 2015
1 parent 69ded69 commit e091ba3
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/libstd/path.rs
Expand Up @@ -1184,14 +1184,6 @@ impl AsRef<OsStr> for PathBuf {
}
}

#[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 {
Expand Down Expand Up @@ -1652,14 +1644,6 @@ impl AsRef<OsStr> for Path {
}
}

#[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> {
Expand Down Expand Up @@ -1711,22 +1695,6 @@ impl cmp::Ord for Path {
}
}

/// 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 }
Expand Down

0 comments on commit e091ba3

Please sign in to comment.