diff options
| author | bors <bors@rust-lang.org> | 2014-04-18 18:46:33 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-18 18:46:33 -0700 |
| commit | af24045ff0e17764524a9eaf243479a3260c2d8b (patch) | |
| tree | bc160d119b2d963afa53e9bbb59aacee6bdc4ecd /src/libstd/path | |
| parent | 9b7cfd3c724bbad9dd8a0115bb2619f307b73f8c (diff) | |
| parent | 919889a1d688a6bbe2edac8705f048f06b1b455c (diff) | |
| download | rust-af24045ff0e17764524a9eaf243479a3260c2d8b.tar.gz rust-af24045ff0e17764524a9eaf243479a3260c2d8b.zip | |
auto merge of #13607 : brson/rust/to_owned, r=brson
Continues https://github.com/mozilla/rust/pull/13548
Diffstat (limited to 'src/libstd/path')
| -rw-r--r-- | src/libstd/path/posix.rs | 5 | ||||
| -rw-r--r-- | src/libstd/path/windows.rs | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 47f9604d63f..4affea37e35 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -459,6 +459,7 @@ mod tests { use prelude::*; use super::*; use str; + use str::StrSlice; macro_rules! t( (s: $path:expr, $exp:expr) => ( @@ -766,7 +767,7 @@ mod tests { t!(s: "a/b/c", ["d", "e"], "a/b/c/d/e"); t!(s: "a/b/c", ["d", "/e"], "/e"); t!(s: "a/b/c", ["d", "/e", "f"], "/e/f"); - t!(s: "a/b/c", [~"d", ~"e"], "a/b/c/d/e"); + t!(s: "a/b/c", ["d".to_owned(), "e".to_owned()], "a/b/c/d/e"); t!(v: b!("a/b/c"), [b!("d"), b!("e")], b!("a/b/c/d/e")); t!(v: b!("a/b/c"), [b!("d"), b!("/e"), b!("f")], b!("/e/f")); t!(v: b!("a/b/c"), [Vec::from_slice(b!("d")), Vec::from_slice(b!("e"))], b!("a/b/c/d/e")); @@ -871,7 +872,7 @@ mod tests { t!(s: "a/b/c", ["d", "e"], "a/b/c/d/e"); t!(s: "a/b/c", ["..", "d"], "a/b/d"); t!(s: "a/b/c", ["d", "/e", "f"], "/e/f"); - t!(s: "a/b/c", [~"d", ~"e"], "a/b/c/d/e"); + t!(s: "a/b/c", ["d".to_owned(), "e".to_owned()], "a/b/c/d/e"); t!(v: b!("a/b/c"), [b!("d"), b!("e")], b!("a/b/c/d/e")); t!(v: b!("a/b/c"), [Vec::from_slice(b!("d")), Vec::from_slice(b!("e"))], b!("a/b/c/d/e")); } diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 58c7aaa2d32..74ca8dc5785 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -1314,9 +1314,9 @@ mod tests { #[test] fn test_display_str() { let path = Path::new("foo"); - assert_eq!(path.display().to_str(), ~"foo"); + assert_eq!(path.display().to_str(), "foo".to_owned()); let path = Path::new(b!("\\")); - assert_eq!(path.filename_display().to_str(), ~""); + assert_eq!(path.filename_display().to_str(), "".to_owned()); let path = Path::new("foo"); let mo = path.display().as_maybe_owned(); @@ -1577,7 +1577,7 @@ mod tests { t!(s: "a\\b\\c", ["d", "e"], "a\\b\\c\\d\\e"); t!(s: "a\\b\\c", ["d", "\\e"], "\\e"); t!(s: "a\\b\\c", ["d", "\\e", "f"], "\\e\\f"); - t!(s: "a\\b\\c", [~"d", ~"e"], "a\\b\\c\\d\\e"); + t!(s: "a\\b\\c", ["d".to_owned(), "e".to_owned()], "a\\b\\c\\d\\e"); t!(v: b!("a\\b\\c"), [b!("d"), b!("e")], b!("a\\b\\c\\d\\e")); t!(v: b!("a\\b\\c"), [b!("d"), b!("\\e"), b!("f")], b!("\\e\\f")); t!(v: b!("a\\b\\c"), [Vec::from_slice(b!("d")), Vec::from_slice(b!("e"))], @@ -1718,7 +1718,7 @@ mod tests { t!(s: "a\\b\\c", ["d", "e"], "a\\b\\c\\d\\e"); t!(s: "a\\b\\c", ["..", "d"], "a\\b\\d"); t!(s: "a\\b\\c", ["d", "\\e", "f"], "\\e\\f"); - t!(s: "a\\b\\c", [~"d", ~"e"], "a\\b\\c\\d\\e"); + t!(s: "a\\b\\c", ["d".to_owned(), "e".to_owned()], "a\\b\\c\\d\\e"); t!(v: b!("a\\b\\c"), [b!("d"), b!("e")], b!("a\\b\\c\\d\\e")); t!(v: b!("a\\b\\c"), [Vec::from_slice(b!("d")), Vec::from_slice(b!("e"))], b!("a\\b\\c\\d\\e")); |
