From bde309a29fc3ebe2429a622befe76c12bec18cf2 Mon Sep 17 00:00:00 2001 From: Joseph Crail Date: Thu, 10 Dec 2015 14:20:01 -0500 Subject: [PATCH] Remove trait shim needed before Path stabilized Now that Path has stabilized in Rust 1.5, I removed the UUPathExt trait needed to support stable, beta, and nightly. --- src/uucore/fs.rs | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/uucore/fs.rs b/src/uucore/fs.rs index f875f679b..682abe00c 100644 --- a/src/uucore/fs.rs +++ b/src/uucore/fs.rs @@ -7,11 +7,6 @@ * file that was distributed with this source code. */ -// Based on the pattern using by Cargo, I created a shim over the -// standard PathExt trait, so that the unstable path methods could -// be backported to stable (<= 1.1). This will likely be dropped -// when the path trait stabilizes. - #[cfg(unix)] use super::libc; use std::env; @@ -19,31 +14,6 @@ use std::fs; use std::io::{Error, ErrorKind, Result}; use std::path::{Component, Path, PathBuf}; -pub trait UUPathExt { - fn uu_exists(&self) -> bool; - fn uu_is_file(&self) -> bool; - fn uu_is_dir(&self) -> bool; - fn uu_metadata(&self) -> Result; -} - -impl UUPathExt for Path { - fn uu_exists(&self) -> bool { - fs::metadata(self).is_ok() - } - - fn uu_is_file(&self) -> bool { - fs::metadata(self).map(|m| m.is_file()).unwrap_or(false) - } - - fn uu_is_dir(&self) -> bool { - fs::metadata(self).map(|m| m.is_dir()).unwrap_or(false) - } - - fn uu_metadata(&self) -> Result { - fs::metadata(self) - } -} - #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum CanonicalizeMode { None,