about summary refs log tree commit diff
path: root/src/libstd/path
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-18 18:46:33 -0700
committerbors <bors@rust-lang.org>2014-04-18 18:46:33 -0700
commitaf24045ff0e17764524a9eaf243479a3260c2d8b (patch)
treebc160d119b2d963afa53e9bbb59aacee6bdc4ecd /src/libstd/path
parent9b7cfd3c724bbad9dd8a0115bb2619f307b73f8c (diff)
parent919889a1d688a6bbe2edac8705f048f06b1b455c (diff)
downloadrust-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.rs5
-rw-r--r--src/libstd/path/windows.rs8
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"));