Skip to content

Commit 40b324f

Browse files
committed
path2: Remove Path.into_str()
1 parent 0c7e8f7 commit 40b324f

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

src/libstd/path/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
179179
str::from_utf8_slice_opt(self.as_vec())
180180
}
181181

182-
/// Converts the Path into an owned string, if possible
183-
fn into_str(self) -> Option<~str>;
184-
185182
/// Returns the path as a byte vector
186183
fn as_vec<'a>(&'a self) -> &'a [u8];
187184

src/libstd/path/posix.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ impl GenericPath for Path {
178178
self.repr
179179
}
180180

181-
fn into_str(self) -> Option<~str> {
182-
str::from_utf8_owned_opt(self.repr)
183-
}
184-
185181
fn dirname<'a>(&'a self) -> &'a [u8] {
186182
match self.sepidx {
187183
None if bytes!("..") == self.repr => self.repr.as_slice(),
@@ -614,12 +610,9 @@ mod tests {
614610
assert_eq!(Path::new(b!("foo/bar")).into_vec(), b!("foo/bar").to_owned());
615611
assert_eq!(Path::new(b!("/foo/../../bar")).into_vec(),
616612
b!("/bar").to_owned());
617-
assert_eq!(Path::new("foo/bar").into_str(), Some(~"foo/bar"));
618-
assert_eq!(Path::new("/foo/../../bar").into_str(), Some(~"/bar"));
619613

620614
let p = Path::new(b!("foo/bar", 0x80));
621615
assert_eq!(p.as_str(), None);
622-
assert_eq!(Path::new(b!("foo", 0xff, "/bar")).into_str(), None);
623616
}
624617

625618
#[test]

src/libstd/path/windows.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,6 @@ impl GenericPath for Path {
327327
Some(self.repr.as_slice())
328328
}
329329

330-
/// See `GenericPath::into_str` for info.
331-
/// Always returns a `Some` value.
332-
#[inline]
333-
fn into_str(self) -> Option<~str> {
334-
Some(self.repr)
335-
}
336-
337330
#[inline]
338331
fn as_vec<'a>(&'a self) -> &'a [u8] {
339332
self.repr.as_bytes()
@@ -1260,8 +1253,6 @@ mod tests {
12601253
assert_eq!(Path::new(b!("foo\\bar")).into_vec(), b!("foo\\bar").to_owned());
12611254
assert_eq!(Path::new(b!("\\foo\\..\\..\\bar")).into_vec(),
12621255
b!("\\bar").to_owned());
1263-
assert_eq!(Path::new("foo\\bar").into_str(), Some(~"foo\\bar"));
1264-
assert_eq!(Path::new("\\foo\\..\\..\\bar").into_str(), Some(~"\\bar"));
12651256

12661257
t!(s: Path::new("\\\\a"), "\\a");
12671258
t!(s: Path::new("\\\\a\\"), "\\a");

0 commit comments

Comments
 (0)