std: Remove deprecated functionality from 1.5
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
This commit is contained in:
parent
08a5b112ed
commit
da50f7c288
48 changed files with 112 additions and 1437 deletions
|
@ -1178,85 +1178,6 @@ impl Iterator for WalkDir {
|
|||
}
|
||||
}
|
||||
|
||||
/// Utility methods for paths.
|
||||
#[unstable(feature = "path_ext_deprecated",
|
||||
reason = "The precise set of methods exposed on this trait may \
|
||||
change and some methods may be removed. For stable code, \
|
||||
see the std::fs::metadata function.",
|
||||
issue = "27725")]
|
||||
#[rustc_deprecated(since = "1.5.0", reason = "replaced with inherent methods")]
|
||||
pub trait PathExt {
|
||||
/// Gets information on the file, directory, etc at this path.
|
||||
///
|
||||
/// Consult the `fs::metadata` documentation for more info.
|
||||
///
|
||||
/// This call preserves identical runtime/error semantics with
|
||||
/// `fs::metadata`.
|
||||
fn metadata(&self) -> io::Result<Metadata>;
|
||||
|
||||
/// Gets information on the file, directory, etc at this path.
|
||||
///
|
||||
/// Consult the `fs::symlink_metadata` documentation for more info.
|
||||
///
|
||||
/// This call preserves identical runtime/error semantics with
|
||||
/// `fs::symlink_metadata`.
|
||||
fn symlink_metadata(&self) -> io::Result<Metadata>;
|
||||
|
||||
/// Returns the canonical form of a path, normalizing all components and
|
||||
/// eliminate all symlinks.
|
||||
///
|
||||
/// This call preserves identical runtime/error semantics with
|
||||
/// `fs::canonicalize`.
|
||||
fn canonicalize(&self) -> io::Result<PathBuf>;
|
||||
|
||||
/// Reads the symlink at this path.
|
||||
///
|
||||
/// For more information see `fs::read_link`.
|
||||
fn read_link(&self) -> io::Result<PathBuf>;
|
||||
|
||||
/// Reads the directory at this path.
|
||||
///
|
||||
/// For more information see `fs::read_dir`.
|
||||
fn read_dir(&self) -> io::Result<ReadDir>;
|
||||
|
||||
/// Boolean value indicator whether the underlying file exists on the local
|
||||
/// filesystem. Returns false in exactly the cases where `fs::metadata`
|
||||
/// fails.
|
||||
fn exists(&self) -> bool;
|
||||
|
||||
/// Whether the underlying implementation (be it a file path, or something
|
||||
/// else) points at a "regular file" on the FS. Will return false for paths
|
||||
/// to non-existent locations or directories or other non-regular files
|
||||
/// (named pipes, etc). Follows links when making this determination.
|
||||
fn is_file(&self) -> bool;
|
||||
|
||||
/// Whether the underlying implementation (be it a file path, or something
|
||||
/// else) is pointing at a directory in the underlying FS. Will return
|
||||
/// false for paths to non-existent locations or if the item is not a
|
||||
/// directory (eg files, named pipes, etc). Follows links when making this
|
||||
/// determination.
|
||||
fn is_dir(&self) -> bool;
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
#[unstable(feature = "path_ext_deprecated", issue = "27725")]
|
||||
impl PathExt for Path {
|
||||
fn metadata(&self) -> io::Result<Metadata> { metadata(self) }
|
||||
fn symlink_metadata(&self) -> io::Result<Metadata> { symlink_metadata(self) }
|
||||
fn canonicalize(&self) -> io::Result<PathBuf> { canonicalize(self) }
|
||||
fn read_link(&self) -> io::Result<PathBuf> { read_link(self) }
|
||||
fn read_dir(&self) -> io::Result<ReadDir> { read_dir(self) }
|
||||
fn exists(&self) -> bool { metadata(self).is_ok() }
|
||||
|
||||
fn is_file(&self) -> bool {
|
||||
metadata(self).map(|s| s.is_file()).unwrap_or(false)
|
||||
}
|
||||
|
||||
fn is_dir(&self) -> bool {
|
||||
metadata(self).map(|s| s.is_dir()).unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
/// Changes the permissions found on a file or a directory.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue