about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2013-10-15 20:01:33 -0700
committerKevin Ballard <kevin@sb.org>2013-10-16 10:26:48 -0700
commit40b324f0dec364a9fa71f9f8b47b8ab156f6d61e (patch)
tree4f2bc03c69e8361aa9b17a0e418ea5f98a880a05 /src/libstd
parent0c7e8f7a92318d19fd9de96ba70fa36fc41de1e2 (diff)
downloadrust-40b324f0dec364a9fa71f9f8b47b8ab156f6d61e.tar.gz
rust-40b324f0dec364a9fa71f9f8b47b8ab156f6d61e.zip
path2: Remove Path.into_str()
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/path/mod.rs3
-rw-r--r--src/libstd/path/posix.rs7
-rw-r--r--src/libstd/path/windows.rs9
3 files changed, 0 insertions, 19 deletions
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index 08a29f6552a..4962b63c8cf 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -179,9 +179,6 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
         str::from_utf8_slice_opt(self.as_vec())
     }
 
-    /// Converts the Path into an owned string, if possible
-    fn into_str(self) -> Option<~str>;
-
     /// Returns the path as a byte vector
     fn as_vec<'a>(&'a self) -> &'a [u8];
 
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index a7c89cb6029..5eea65a5b91 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -178,10 +178,6 @@ impl GenericPath for Path {
         self.repr
     }
 
-    fn into_str(self) -> Option<~str> {
-        str::from_utf8_owned_opt(self.repr)
-    }
-
     fn dirname<'a>(&'a self) -> &'a [u8] {
         match self.sepidx {
             None if bytes!("..") == self.repr => self.repr.as_slice(),
@@ -614,12 +610,9 @@ mod tests {
         assert_eq!(Path::new(b!("foo/bar")).into_vec(), b!("foo/bar").to_owned());
         assert_eq!(Path::new(b!("/foo/../../bar")).into_vec(),
                    b!("/bar").to_owned());
-        assert_eq!(Path::new("foo/bar").into_str(), Some(~"foo/bar"));
-        assert_eq!(Path::new("/foo/../../bar").into_str(), Some(~"/bar"));
 
         let p = Path::new(b!("foo/bar", 0x80));
         assert_eq!(p.as_str(), None);
-        assert_eq!(Path::new(b!("foo", 0xff, "/bar")).into_str(), None);
     }
 
     #[test]
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index 77232196f78..9576e62f439 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -327,13 +327,6 @@ impl GenericPath for Path {
         Some(self.repr.as_slice())
     }
 
-    /// See `GenericPath::into_str` for info.
-    /// Always returns a `Some` value.
-    #[inline]
-    fn into_str(self) -> Option<~str> {
-        Some(self.repr)
-    }
-
     #[inline]
     fn as_vec<'a>(&'a self) -> &'a [u8] {
         self.repr.as_bytes()
@@ -1260,8 +1253,6 @@ mod tests {
         assert_eq!(Path::new(b!("foo\\bar")).into_vec(), b!("foo\\bar").to_owned());
         assert_eq!(Path::new(b!("\\foo\\..\\..\\bar")).into_vec(),
                    b!("\\bar").to_owned());
-        assert_eq!(Path::new("foo\\bar").into_str(), Some(~"foo\\bar"));
-        assert_eq!(Path::new("\\foo\\..\\..\\bar").into_str(), Some(~"\\bar"));
 
         t!(s: Path::new("\\\\a"), "\\a");
         t!(s: Path::new("\\\\a\\"), "\\a");