]> git.lizzy.rs Git - rust.git/commitdiff
std: Remove String's to_owned
authorRicho Healey <richo@psych0tik.net>
Sun, 25 May 2014 10:10:11 +0000 (03:10 -0700)
committerRicho Healey <richo@psych0tik.net>
Tue, 27 May 2014 18:11:15 +0000 (11:11 -0700)
113 files changed:
src/compiletest/compiletest.rs
src/compiletest/runtest.rs
src/doc/rust.md
src/libcollections/bitv.rs
src/libcollections/btree.rs
src/libcollections/hashmap.rs
src/libcollections/lru_cache.rs
src/libcore/fmt/num.rs
src/libcore/mem.rs
src/libcore/slice.rs
src/libgetopts/lib.rs
src/libnative/io/process.rs
src/librustc/back/link.rs
src/librustc/driver/mod.rs
src/librustc/metadata/tydecode.rs
src/librustc/middle/resolve.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/trans/reflect.rs
src/librustc/middle/trans/tvec.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/infer/error_reporting.rs
src/librustc/middle/typeck/infer/test.rs
src/librustdoc/html/format.rs
src/librustdoc/html/markdown.rs
src/librustdoc/html/render.rs
src/librustdoc/passes.rs
src/librustdoc/test.rs
src/libsemver/lib.rs
src/libstd/c_str.rs
src/libstd/fmt.rs
src/libstd/hash/mod.rs
src/libstd/io/mod.rs
src/libstd/slice.rs
src/libstd/str.rs
src/libstd/task.rs
src/libstd/vec.rs
src/libsync/comm.rs
src/libsync/future.rs
src/libsyntax/crateid.rs
src/libsyntax/ext/asm.rs
src/libsyntax/ext/deriving/encodable.rs
src/libsyntax/ext/quote.rs
src/libsyntax/parse/parser.rs
src/libterm/terminfo/parser/compiled.rs
src/libtest/lib.rs
src/test/bench/core-uint-to-str.rs
src/test/bench/msgsend-ring-mutex-arcs.rs
src/test/bench/msgsend-ring-rw-arcs.rs
src/test/bench/shootout-ackermann.rs
src/test/bench/shootout-fibo.rs
src/test/bench/std-smallintmap.rs
src/test/bench/sudoku.rs
src/test/bench/task-perf-jargon-metal-smoke.rs
src/test/bench/task-perf-one-million.rs
src/test/bench/task-perf-spawnalot.rs
src/test/compile-fail/borrowck-move-in-irrefut-pat.rs
src/test/compile-fail/borrowck-move-out-of-overloaded-deref.rs
src/test/compile-fail/borrowck-ref-into-rvalue.rs
src/test/compile-fail/circular_modules_main.rs
src/test/compile-fail/error-should-say-copy-not-pod.rs
src/test/compile-fail/issue-10412.rs
src/test/compile-fail/issue-6458-4.rs
src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs
src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs
src/test/compile-fail/moves-based-on-type-match-bindings.rs
src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs
src/test/compile-fail/multitrait.rs
src/test/compile-fail/syntax-extension-minor.rs
src/test/compile-fail/trait-coercion-generic-regions.rs
src/test/compile-fail/use-after-move-based-on-type.rs
src/test/pretty/match-naked-expr-medium.rs
src/test/pretty/match-naked-expr.rs
src/test/run-fail/fail-task-name-owned.rs
src/test/run-fail/unwind-box-str.rs
src/test/run-fail/unwind-match.rs
src/test/run-pass-fulldeps/qquote.rs
src/test/run-pass/assert-eq-macro-success.rs
src/test/run-pass/box-compare.rs
src/test/run-pass/cci_nested_exe.rs
src/test/run-pass/class-poly-methods-cross-crate.rs
src/test/run-pass/class-poly-methods.rs
src/test/run-pass/cleanup-shortcircuit.rs
src/test/run-pass/const-bound.rs
src/test/run-pass/const-str-ptr.rs
src/test/run-pass/expr-if-box.rs
src/test/run-pass/expr-match-box.rs
src/test/run-pass/generic-tag-corruption.rs
src/test/run-pass/ifmt.rs
src/test/run-pass/inferred-suffix-in-pattern-range.rs
src/test/run-pass/issue-1257.rs
src/test/run-pass/issue-1974.rs
src/test/run-pass/issue-2734.rs
src/test/run-pass/issue-2735.rs
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-3556.rs
src/test/run-pass/issue-4241.rs
src/test/run-pass/linear-for-loop.rs
src/test/run-pass/logging-separate-lines.rs
src/test/run-pass/match-pipe-binding.rs
src/test/run-pass/moves-based-on-type-capture-clause.rs
src/test/run-pass/overload-index-operator.rs
src/test/run-pass/overloaded-autoderef.rs
src/test/run-pass/overloaded-deref.rs
src/test/run-pass/rename-directory.rs
src/test/run-pass/send_str_hashmap.rs
src/test/run-pass/send_str_treemap.rs
src/test/run-pass/seq-compare.rs
src/test/run-pass/str-idx.rs
src/test/run-pass/struct-lit-functional-no-fields.rs
src/test/run-pass/task-comm-16.rs
src/test/run-pass/trait-with-bounds-default.rs
src/test/run-pass/uniq-cc-generic.rs

index 8ea718c7f276374b055bf149cb23df9f355a4f44..a82e574556a02b04244ecf90c40e8c3bbde7f466 100644 (file)
@@ -314,10 +314,10 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
     // Pretty-printer does not work with .rc files yet
     let valid_extensions =
         match config.mode {
-          Pretty => vec!(".rs".to_owned()),
-          _ => vec!(".rc".to_owned(), ".rs".to_owned())
+          Pretty => vec!(".rs".to_string()),
+          _ => vec!(".rc".to_string(), ".rs".to_string())
         };
-    let invalid_prefixes = vec!(".".to_owned(), "#".to_owned(), "~".to_owned());
+    let invalid_prefixes = vec!(".".to_string(), "#".to_string(), "~".to_string());
     let name = testfile.filename_str().unwrap();
 
     let mut valid = false;
index 7ddbb83155cf3c4cd08b74f1e60a459c84cc1aef..f1dd783214a5b75271b5618be07dcdf2c3c2b94e 100644 (file)
@@ -1034,7 +1034,7 @@ fn compose_and_run_compiler(
 
     let aux_dir = aux_output_dir_name(config, testfile);
     // FIXME (#9639): This needs to handle non-utf8 paths
-    let extra_link_args = vec!("-L".to_owned(), aux_dir.as_str().unwrap().to_owned());
+    let extra_link_args = vec!("-L".to_string(), aux_dir.as_str().unwrap().to_owned());
 
     for rel_ab in props.aux_builds.iter() {
         let abs_ab = config.aux_base.join(rel_ab.as_slice());
index d860c50f0a2154aa7712212f628c0d76dc70136c..2f002dcfb9a706a4a8128fc292c72345e41209a1 100644 (file)
@@ -3538,7 +3538,7 @@ allocated on the heap (unlike closures). An example of creating and calling a
 procedure:
 
 ```rust
-let string = "Hello".to_owned();
+let string = "Hello".to_string();
 
 // Creates a new procedure, passing it to the `spawn` function.
 spawn(proc() {
index f2059792500a2f7c13637a7dc71b14db68e7e6ad..0b5d499c533bc37d7bac5da57568bde590690000 100644 (file)
@@ -988,10 +988,10 @@ mod tests {
     #[test]
     fn test_to_str() {
         let zerolen = Bitv::new(0u, false);
-        assert_eq!(zerolen.to_str(), "".to_owned());
+        assert_eq!(zerolen.to_str(), "".to_string());
 
         let eightbits = Bitv::new(8u, false);
-        assert_eq!(eightbits.to_str(), "00000000".to_owned());
+        assert_eq!(eightbits.to_str(), "00000000".to_string());
     }
 
     #[test]
@@ -1014,7 +1014,7 @@ fn test_2_elements() {
         let mut b = bitv::Bitv::new(2, false);
         b.set(0, true);
         b.set(1, false);
-        assert_eq!(b.to_str(), "10".to_owned());
+        assert_eq!(b.to_str(), "10".to_string());
     }
 
     #[test]
@@ -1343,7 +1343,7 @@ fn test_to_bytes() {
     #[test]
     fn test_from_bools() {
         assert!(from_bools([true, false, true, true]).to_str() ==
-            "1011".to_owned());
+            "1011".to_string());
     }
 
     #[test]
index ba83ad8d37c9a77dfd901f4eae13afbc97b210c8..184a59303f3a4c2e5fa7ee375f7c10afe81b9ac7 100644 (file)
@@ -778,70 +778,70 @@ mod test_btree {
     //Tests the functionality of the insert methods (which are unfinished).
     #[test]
     fn insert_test_one() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
-        let is_insert = b.insert(2, "xyz".to_owned());
+        let b = BTree::new(1, "abc".to_string(), 2);
+        let is_insert = b.insert(2, "xyz".to_string());
         //println!("{}", is_insert.clone().to_str());
         assert!(is_insert.root.is_leaf());
     }
 
     #[test]
     fn insert_test_two() {
-        let leaf_elt_1 = LeafElt::new(1, "aaa".to_owned());
-        let leaf_elt_2 = LeafElt::new(2, "bbb".to_owned());
-        let leaf_elt_3 = LeafElt::new(3, "ccc".to_owned());
+        let leaf_elt_1 = LeafElt::new(1, "aaa".to_string());
+        let leaf_elt_2 = LeafElt::new(2, "bbb".to_string());
+        let leaf_elt_3 = LeafElt::new(3, "ccc".to_string());
         let n = Node::new_leaf(vec!(leaf_elt_1, leaf_elt_2, leaf_elt_3));
         let b = BTree::new_with_node_len(n, 3, 2);
-        //println!("{}", b.clone().insert(4, "ddd".to_owned()).to_str());
-        assert!(b.insert(4, "ddd".to_owned()).root.is_leaf());
+        //println!("{}", b.clone().insert(4, "ddd".to_string()).to_str());
+        assert!(b.insert(4, "ddd".to_string()).root.is_leaf());
     }
 
     #[test]
     fn insert_test_three() {
-        let leaf_elt_1 = LeafElt::new(1, "aaa".to_owned());
-        let leaf_elt_2 = LeafElt::new(2, "bbb".to_owned());
-        let leaf_elt_3 = LeafElt::new(3, "ccc".to_owned());
-        let leaf_elt_4 = LeafElt::new(4, "ddd".to_owned());
+        let leaf_elt_1 = LeafElt::new(1, "aaa".to_string());
+        let leaf_elt_2 = LeafElt::new(2, "bbb".to_string());
+        let leaf_elt_3 = LeafElt::new(3, "ccc".to_string());
+        let leaf_elt_4 = LeafElt::new(4, "ddd".to_string());
         let n = Node::new_leaf(vec!(leaf_elt_1, leaf_elt_2, leaf_elt_3, leaf_elt_4));
         let b = BTree::new_with_node_len(n, 3, 2);
-        //println!("{}", b.clone().insert(5, "eee".to_owned()).to_str());
-        assert!(!b.insert(5, "eee".to_owned()).root.is_leaf());
+        //println!("{}", b.clone().insert(5, "eee".to_string()).to_str());
+        assert!(!b.insert(5, "eee".to_string()).root.is_leaf());
     }
 
     #[test]
     fn insert_test_four() {
-        let leaf_elt_1 = LeafElt::new(1, "aaa".to_owned());
-        let leaf_elt_2 = LeafElt::new(2, "bbb".to_owned());
-        let leaf_elt_3 = LeafElt::new(3, "ccc".to_owned());
-        let leaf_elt_4 = LeafElt::new(4, "ddd".to_owned());
+        let leaf_elt_1 = LeafElt::new(1, "aaa".to_string());
+        let leaf_elt_2 = LeafElt::new(2, "bbb".to_string());
+        let leaf_elt_3 = LeafElt::new(3, "ccc".to_string());
+        let leaf_elt_4 = LeafElt::new(4, "ddd".to_string());
         let n = Node::new_leaf(vec!(leaf_elt_1, leaf_elt_2, leaf_elt_3, leaf_elt_4));
         let mut b = BTree::new_with_node_len(n, 3, 2);
-        b = b.clone().insert(5, "eee".to_owned());
-        b = b.clone().insert(6, "fff".to_owned());
-        b = b.clone().insert(7, "ggg".to_owned());
-        b = b.clone().insert(8, "hhh".to_owned());
-        b = b.clone().insert(0, "omg".to_owned());
+        b = b.clone().insert(5, "eee".to_string());
+        b = b.clone().insert(6, "fff".to_string());
+        b = b.clone().insert(7, "ggg".to_string());
+        b = b.clone().insert(8, "hhh".to_string());
+        b = b.clone().insert(0, "omg".to_string());
         //println!("{}", b.clone().to_str());
         assert!(!b.root.is_leaf());
     }
 
     #[test]
     fn bsearch_test_one() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
+        let b = BTree::new(1, "abc".to_string(), 2);
         assert_eq!(Some(1), b.root.bsearch_node(2));
     }
 
     #[test]
     fn bsearch_test_two() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
+        let b = BTree::new(1, "abc".to_string(), 2);
         assert_eq!(Some(0), b.root.bsearch_node(0));
     }
 
     #[test]
     fn bsearch_test_three() {
-        let leaf_elt_1 = LeafElt::new(1, "aaa".to_owned());
-        let leaf_elt_2 = LeafElt::new(2, "bbb".to_owned());
-        let leaf_elt_3 = LeafElt::new(4, "ccc".to_owned());
-        let leaf_elt_4 = LeafElt::new(5, "ddd".to_owned());
+        let leaf_elt_1 = LeafElt::new(1, "aaa".to_string());
+        let leaf_elt_2 = LeafElt::new(2, "bbb".to_string());
+        let leaf_elt_3 = LeafElt::new(4, "ccc".to_string());
+        let leaf_elt_4 = LeafElt::new(5, "ddd".to_string());
         let n = Node::new_leaf(vec!(leaf_elt_1, leaf_elt_2, leaf_elt_3, leaf_elt_4));
         let b = BTree::new_with_node_len(n, 3, 2);
         assert_eq!(Some(2), b.root.bsearch_node(3));
@@ -849,10 +849,10 @@ fn bsearch_test_three() {
 
     #[test]
     fn bsearch_test_four() {
-        let leaf_elt_1 = LeafElt::new(1, "aaa".to_owned());
-        let leaf_elt_2 = LeafElt::new(2, "bbb".to_owned());
-        let leaf_elt_3 = LeafElt::new(4, "ccc".to_owned());
-        let leaf_elt_4 = LeafElt::new(5, "ddd".to_owned());
+        let leaf_elt_1 = LeafElt::new(1, "aaa".to_string());
+        let leaf_elt_2 = LeafElt::new(2, "bbb".to_string());
+        let leaf_elt_3 = LeafElt::new(4, "ccc".to_string());
+        let leaf_elt_4 = LeafElt::new(5, "ddd".to_string());
         let n = Node::new_leaf(vec!(leaf_elt_1, leaf_elt_2, leaf_elt_3, leaf_elt_4));
         let b = BTree::new_with_node_len(n, 3, 2);
         assert_eq!(Some(4), b.root.bsearch_node(800));
@@ -861,15 +861,15 @@ fn bsearch_test_four() {
     //Tests the functionality of the get method.
     #[test]
     fn get_test() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
+        let b = BTree::new(1, "abc".to_string(), 2);
         let val = b.get(1);
-        assert_eq!(val, Some("abc".to_owned()));
+        assert_eq!(val, Some("abc".to_string()));
     }
 
     //Tests the BTree's clone() method.
     #[test]
     fn btree_clone_test() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
+        let b = BTree::new(1, "abc".to_string(), 2);
         let b2 = b.clone();
         assert!(b.root == b2.root)
     }
@@ -877,32 +877,32 @@ fn btree_clone_test() {
     //Tests the BTree's cmp() method when one node is "less than" another.
     #[test]
     fn btree_cmp_test_less() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
-        let b2 = BTree::new(2, "bcd".to_owned(), 2);
+        let b = BTree::new(1, "abc".to_string(), 2);
+        let b2 = BTree::new(2, "bcd".to_string(), 2);
         assert!(&b.cmp(&b2) == &Less)
     }
 
     //Tests the BTree's cmp() method when two nodes are equal.
     #[test]
     fn btree_cmp_test_eq() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
-        let b2 = BTree::new(1, "bcd".to_owned(), 2);
+        let b = BTree::new(1, "abc".to_string(), 2);
+        let b2 = BTree::new(1, "bcd".to_string(), 2);
         assert!(&b.cmp(&b2) == &Equal)
     }
 
     //Tests the BTree's cmp() method when one node is "greater than" another.
     #[test]
     fn btree_cmp_test_greater() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
-        let b2 = BTree::new(2, "bcd".to_owned(), 2);
+        let b = BTree::new(1, "abc".to_string(), 2);
+        let b2 = BTree::new(2, "bcd".to_string(), 2);
         assert!(&b2.cmp(&b) == &Greater)
     }
 
     //Tests the BTree's to_str() method.
     #[test]
     fn btree_tostr_test() {
-        let b = BTree::new(1, "abc".to_owned(), 2);
-        assert_eq!(b.to_str(), "Key: 1, value: abc;".to_owned())
+        let b = BTree::new(1, "abc".to_string(), 2);
+        assert_eq!(b.to_str(), "Key: 1, value: abc;".to_string())
     }
 
 }
index 1b79b84ff90852dd9691bb4b689a7ced11aa8400..0fe1cb6ee72418d1499898590b3967b610a507a6 100644 (file)
@@ -2026,9 +2026,9 @@ fn test_find_equiv() {
         let mut m = HashMap::new();
 
         let (foo, bar, baz) = (1,2,3);
-        m.insert("foo".to_owned(), foo);
-        m.insert("bar".to_owned(), bar);
-        m.insert("baz".to_owned(), baz);
+        m.insert("foo".to_string(), foo);
+        m.insert("bar".to_string(), bar);
+        m.insert("baz".to_string(), baz);
 
 
         assert_eq!(m.find_equiv(&("foo")), Some(&foo));
@@ -2313,8 +2313,8 @@ fn test_show() {
 
         let set_str = format!("{}", set);
 
-        assert!(set_str == "{1, 2}".to_owned() || set_str == "{2, 1}".to_owned());
-        assert_eq!(format!("{}", empty), "{}".to_owned());
+        assert!(set_str == "{1, 2}".to_string() || set_str == "{2, 1}".to_string());
+        assert_eq!(format!("{}", empty), "{}".to_string());
     }
 }
 
index 91b725178f347f8682f54ea01beabdb81f29bd75..f4a6cdaa712025cb9ba8bbd4d29b3bd354233ae6 100644 (file)
@@ -319,15 +319,15 @@ fn test_to_str() {
         cache.put(1, 10);
         cache.put(2, 20);
         cache.put(3, 30);
-        assert_eq!(cache.to_str(), "{3: 30, 2: 20, 1: 10}".to_owned());
+        assert_eq!(cache.to_str(), "{3: 30, 2: 20, 1: 10}".to_string());
         cache.put(2, 22);
-        assert_eq!(cache.to_str(), "{2: 22, 3: 30, 1: 10}".to_owned());
+        assert_eq!(cache.to_str(), "{2: 22, 3: 30, 1: 10}".to_string());
         cache.put(6, 60);
-        assert_eq!(cache.to_str(), "{6: 60, 2: 22, 3: 30}".to_owned());
+        assert_eq!(cache.to_str(), "{6: 60, 2: 22, 3: 30}".to_string());
         cache.get(&3);
-        assert_eq!(cache.to_str(), "{3: 30, 6: 60, 2: 22}".to_owned());
+        assert_eq!(cache.to_str(), "{3: 30, 6: 60, 2: 22}".to_string());
         cache.change_capacity(2);
-        assert_eq!(cache.to_str(), "{3: 30, 6: 60}".to_owned());
+        assert_eq!(cache.to_str(), "{3: 30, 6: 60}".to_string());
     }
 
     #[test]
@@ -338,6 +338,6 @@ fn test_clear() {
         cache.clear();
         assert!(cache.get(&1).is_none());
         assert!(cache.get(&2).is_none());
-        assert_eq!(cache.to_str(), "{}".to_owned());
+        assert_eq!(cache.to_str(), "{}".to_string());
     }
 }
index 75f67c3df65d706d66393c029064ea2cddb0b494..731911185ff7e4e0b382cb2c5e0772977507e99f 100644 (file)
@@ -140,7 +140,7 @@ fn digit(&self, x: u8) -> u8 {
 ///
 /// ~~~
 /// use std::fmt::radix;
-/// assert_eq!(format!("{}", radix(55, 36)), "1j".to_owned());
+/// assert_eq!(format!("{}", radix(55, 36)), "1j".to_string());
 /// ~~~
 pub fn radix<T>(x: T, base: u8) -> RadixFmt<T, Radix> {
     RadixFmt(x, Radix::new(base))
index dcec07ef24e3279beb8b44d89fd7f00b36a10483..6135f4dcca4211a2290afb2e5080a9d7e1a97f2e 100644 (file)
@@ -552,7 +552,7 @@ fn test_swap() {
 
     #[test]
     fn test_replace() {
-        let mut x = Some("test".to_owned());
+        let mut x = Some("test".to_string());
         let y = replace(&mut x, None);
         assert!(x.is_none());
         assert!(y.is_some());
@@ -576,7 +576,7 @@ impl Foo for int {}
         }
 
         unsafe {
-            assert!(Vec::from_slice([76u8]) == transmute("L".to_owned()));
+            assert!(Vec::from_slice([76u8]) == transmute("L".to_string()));
         }
     }
 }
index 3979a1ad8c8338795ad49eaf9f9672390696a529..31313050165a6d022f7a5af436a35293274dde0a 100644 (file)
@@ -925,15 +925,15 @@ pub trait MutableVector<'a, T> {
     /// # Example
     ///
     /// ```rust
-    /// let mut v = ~["foo".to_owned(), "bar".to_owned(), "baz".to_owned()];
+    /// let mut v = ~["foo".to_string(), "bar".to_string(), "baz".to_string()];
     ///
     /// unsafe {
-    ///     // `"baz".to_owned()` is deallocated.
-    ///     v.unsafe_set(2, "qux".to_owned());
+    ///     // `"baz".to_string()` is deallocated.
+    ///     v.unsafe_set(2, "qux".to_string());
     ///
     ///     // Out of bounds: could cause a crash, or overwriting
     ///     // other data, or something else.
-    ///     // v.unsafe_set(10, "oops".to_owned());
+    ///     // v.unsafe_set(10, "oops".to_string());
     /// }
     /// ```
     unsafe fn unsafe_set(self, index: uint, val: T);
@@ -945,10 +945,10 @@ pub trait MutableVector<'a, T> {
     /// # Example
     ///
     /// ```rust
-    /// let mut v = ["foo".to_owned(), "bar".to_owned()];
+    /// let mut v = ["foo".to_string(), "bar".to_string()];
     ///
-    /// // memory leak! `"bar".to_owned()` is not deallocated.
-    /// unsafe { v.init_elem(1, "baz".to_owned()); }
+    /// // memory leak! `"bar".to_string()` is not deallocated.
+    /// unsafe { v.init_elem(1, "baz".to_string()); }
     /// ```
     unsafe fn init_elem(self, i: uint, val: T);
 
index 85e1a7decc2bbf2021bd2ea6f35bb1b09390a514..0738462b8260eb70dd7e557a2ef54d7fe731d515 100644 (file)
@@ -728,7 +728,7 @@ pub fn usage(brief: &str, opts: &[OptGroup]) -> String {
         each_split_within(desc_normalized_whitespace.as_slice(),
                           54,
                           |substr| {
-            desc_rows.push(substr.to_owned());
+            desc_rows.push(substr.to_string());
             true
         });
 
index d1711c1b890bd522b96220277bdefa1c2cb84404..177b90f2e1acd2c4f7b1976c29a46e7e17d24a39 100644 (file)
@@ -1103,24 +1103,24 @@ fn test_wrapper(prog: &str, args: &[&str]) -> String {
 
         assert_eq!(
             test_wrapper("prog", ["aaa", "bbb", "ccc"]),
-            "prog aaa bbb ccc".to_owned()
+            "prog aaa bbb ccc".to_string()
         );
 
         assert_eq!(
             test_wrapper("C:\\Program Files\\blah\\blah.exe", ["aaa"]),
-            "\"C:\\Program Files\\blah\\blah.exe\" aaa".to_owned()
+            "\"C:\\Program Files\\blah\\blah.exe\" aaa".to_string()
         );
         assert_eq!(
             test_wrapper("C:\\Program Files\\test", ["aa\"bb"]),
-            "\"C:\\Program Files\\test\" aa\\\"bb".to_owned()
+            "\"C:\\Program Files\\test\" aa\\\"bb".to_string()
         );
         assert_eq!(
             test_wrapper("echo", ["a b c"]),
-            "echo \"a b c\"".to_owned()
+            "echo \"a b c\"".to_string()
         );
         assert_eq!(
             test_wrapper("\u03c0\u042f\u97f3\u00e6\u221e", []),
-            "\u03c0\u042f\u97f3\u00e6\u221e".to_owned()
+            "\u03c0\u042f\u97f3\u00e6\u221e".to_string()
         );
     }
 }
index 89a79dbb80d896c185e3072d6b47f92f3fa8ca35..0b1efd3cfbb78bc3b2c28426ab6012c097a9c192 100644 (file)
@@ -703,7 +703,7 @@ pub fn exported_name(path: PathElems, hash: &str, vers: &str) -> String {
     let vers = if vers.len() > 0 && !char::is_XID_start(vers.char_at(0)) {
         format!("v{}", vers)
     } else {
-        vers.to_owned()
+        vers.to_string()
     };
 
     mangle(path, Some(hash), Some(vers.as_slice()))
index e764b07a828b00003c77c8439877b8c9fab2c2e0..998a88bcea9e56c2dbd8182da7b9118fe5386881 100644 (file)
@@ -399,10 +399,10 @@ fn monitor(f: proc():Send) {
                 }
 
                 let xs = [
-                    "the compiler hit an unexpected failure path. this is a bug.".to_owned(),
+                    "the compiler hit an unexpected failure path. this is a bug.".to_string(),
                     format!("we would appreciate a bug report: {}",
                             BUG_REPORT_URL),
-                    "run with `RUST_BACKTRACE=1` for a backtrace".to_owned(),
+                    "run with `RUST_BACKTRACE=1` for a backtrace".to_string(),
                 ];
                 for note in xs.iter() {
                     emitter.emit(None, note.as_slice(), diagnostic::Note)
index 6c9247040433f11d2a4bcb57e451091f812661e2..9fd1fb674501d886db113737fb51df2a43add169 100644 (file)
@@ -451,7 +451,7 @@ fn parse_fn_style(c: char) -> FnStyle {
 fn parse_abi_set(st: &mut PState) -> abi::Abi {
     assert_eq!(next(st), '[');
     scan(st, |c| c == ']', |bytes| {
-        let abi_str = str::from_utf8(bytes).unwrap().to_owned();
+        let abi_str = str::from_utf8(bytes).unwrap().to_string();
         abi::lookup(abi_str.as_slice()).expect(abi_str)
     })
 }
index d3437e60658d7655581bb7fa78585e9c0d49f811..946d2b4a969b9138c72ce623f21064506b7953a8 100644 (file)
@@ -5540,18 +5540,18 @@ fn dump_module(&mut self, module_: Rc<Module>) {
         for (&name, import_resolution) in import_resolutions.iter() {
             let value_repr;
             match import_resolution.target_for_namespace(ValueNS) {
-                None => { value_repr = "".to_owned(); }
+                None => { value_repr = "".to_string(); }
                 Some(_) => {
-                    value_repr = " value:?".to_owned();
+                    value_repr = " value:?".to_string();
                     // FIXME #4954
                 }
             }
 
             let type_repr;
             match import_resolution.target_for_namespace(TypeNS) {
-                None => { type_repr = "".to_owned(); }
+                None => { type_repr = "".to_string(); }
                 Some(_) => {
-                    type_repr = " type:?".to_owned();
+                    type_repr = " type:?".to_string();
                     // FIXME #4954
                 }
             }
index 655910d98a480cecc378a7f350cd852f11d359c1..ee0a802de3f17f257c5412e63c2bb0c0888cc2d7 100644 (file)
@@ -1106,9 +1106,9 @@ pub fn new_fn_ctxt<'a>(ccx: &'a CrateContext,
 
     debug!("new_fn_ctxt(path={}, id={}, param_substs={})",
            if id == -1 {
-               "".to_owned()
+               "".to_string()
            } else {
-               ccx.tcx.map.path_to_str(id).to_owned()
+               ccx.tcx.map.path_to_str(id).to_string()
            },
            id, param_substs.map(|s| s.repr(ccx.tcx())));
 
index 3e3576e6f80587b6299c9148600833fba7984512..94f17172d58f0864fa2870d664b577029bdc410a 100644 (file)
@@ -1146,28 +1146,28 @@ fn basic_type_metadata(cx: &CrateContext, t: ty::t) -> DIType {
     debug!("basic_type_metadata: {:?}", ty::get(t));
 
     let (name, encoding) = match ty::get(t).sty {
-        ty::ty_nil => ("()".to_owned(), DW_ATE_unsigned),
-        ty::ty_bot => ("!".to_owned(), DW_ATE_unsigned),
-        ty::ty_bool => ("bool".to_owned(), DW_ATE_boolean),
-        ty::ty_char => ("char".to_owned(), DW_ATE_unsigned_char),
+        ty::ty_nil => ("()".to_string(), DW_ATE_unsigned),
+        ty::ty_bot => ("!".to_string(), DW_ATE_unsigned),
+        ty::ty_bool => ("bool".to_string(), DW_ATE_boolean),
+        ty::ty_char => ("char".to_string(), DW_ATE_unsigned_char),
         ty::ty_int(int_ty) => match int_ty {
-            ast::TyI => ("int".to_owned(), DW_ATE_signed),
-            ast::TyI8 => ("i8".to_owned(), DW_ATE_signed),
-            ast::TyI16 => ("i16".to_owned(), DW_ATE_signed),
-            ast::TyI32 => ("i32".to_owned(), DW_ATE_signed),
-            ast::TyI64 => ("i64".to_owned(), DW_ATE_signed)
+            ast::TyI => ("int".to_string(), DW_ATE_signed),
+            ast::TyI8 => ("i8".to_string(), DW_ATE_signed),
+            ast::TyI16 => ("i16".to_string(), DW_ATE_signed),
+            ast::TyI32 => ("i32".to_string(), DW_ATE_signed),
+            ast::TyI64 => ("i64".to_string(), DW_ATE_signed)
         },
         ty::ty_uint(uint_ty) => match uint_ty {
-            ast::TyU => ("uint".to_owned(), DW_ATE_unsigned),
-            ast::TyU8 => ("u8".to_owned(), DW_ATE_unsigned),
-            ast::TyU16 => ("u16".to_owned(), DW_ATE_unsigned),
-            ast::TyU32 => ("u32".to_owned(), DW_ATE_unsigned),
-            ast::TyU64 => ("u64".to_owned(), DW_ATE_unsigned)
+            ast::TyU => ("uint".to_string(), DW_ATE_unsigned),
+            ast::TyU8 => ("u8".to_string(), DW_ATE_unsigned),
+            ast::TyU16 => ("u16".to_string(), DW_ATE_unsigned),
+            ast::TyU32 => ("u32".to_string(), DW_ATE_unsigned),
+            ast::TyU64 => ("u64".to_string(), DW_ATE_unsigned)
         },
         ty::ty_float(float_ty) => match float_ty {
-            ast::TyF32 => ("f32".to_owned(), DW_ATE_float),
-            ast::TyF64 => ("f64".to_owned(), DW_ATE_float),
-            ast::TyF128 => ("f128".to_owned(), DW_ATE_float)
+            ast::TyF32 => ("f32".to_string(), DW_ATE_float),
+            ast::TyF64 => ("f64".to_string(), DW_ATE_float),
+            ast::TyF128 => ("f128".to_string(), DW_ATE_float)
         },
         _ => cx.sess().bug("debuginfo::basic_type_metadata - t is invalid type")
     };
index f5f3d4366f6e081f30d5d39f4334c4c72601a99b..4b81463ed795f3dc9d9854b0d41491c6b0ae24eb 100644 (file)
@@ -190,7 +190,7 @@ pub fn visit_ty(&mut self, t: ty::t) {
           ty::ty_rptr(_, ref mt) => {
               match ty::get(mt.ty).sty {
                   ty::ty_vec(ref mt, None) => {
-                      let (name, extra) = ("slice".to_owned(), Vec::new());
+                      let (name, extra) = ("slice".to_string(), Vec::new());
                       let extra = extra.append(self.c_mt(mt).as_slice());
                       self.visit(format!("evec_{}", name).as_slice(),
                                  extra.as_slice())
index 36500cc27f8f69c37802d2775f7a355722d42c95..4421c84e86f3c93325f1a7925615650331f75f06 100644 (file)
@@ -228,7 +228,7 @@ pub fn trans_uniq_vstore<'a>(bcx: &'a Block<'a>,
                              content_expr: &ast::Expr)
                              -> DatumBlock<'a, Expr> {
     /*!
-     * ~[...] and "...".to_owned() allocate boxes in the exchange heap and write
+     * ~[...] and "...".to_string() allocate boxes in the exchange heap and write
      * the array elements into them.
      */
 
@@ -236,7 +236,7 @@ pub fn trans_uniq_vstore<'a>(bcx: &'a Block<'a>,
     let fcx = bcx.fcx;
     let ccx = fcx.ccx;
 
-    // Handle "".to_owned().
+    // Handle "".to_string().
     match content_expr.node {
         ast::ExprLit(lit) => {
             match lit.node {
index bb6b0c51a2734ffa14e03fe98adc1a984137af35..d287abfcda1f77cf6da35f7c30c1345faba8d50f 100644 (file)
@@ -2707,7 +2707,7 @@ fn check_struct_enum_variant(fcx: &FnCtxt,
                     let error = if vst == ast::ExprVstoreSlice {
                         "`&\"string\"` has been removed; use `\"string\"` instead"
                     } else {
-                        "`~\"string\"` has been removed; use `\"string\".to_owned()` instead"
+                        "`~\"string\"` has been removed; use `\"string\".to_string()` instead"
                     };
                     tcx.sess.span_err(expr.span, error);
                     ty::mk_err()
index 6b4da020506c7d1f3bc82263a7f720c9b84a46af..1cbee01db284f46c10774890213f61c6679d52cd 100644 (file)
@@ -808,7 +808,7 @@ fn pick_lifetime(&self,
             // choice of lifetime name deterministic and thus easier to test.
             let mut names = Vec::new();
             for rn in region_names.iter() {
-                let lt_name = token::get_name(*rn).get().to_owned();
+                let lt_name = token::get_name(*rn).get().to_string();
                 names.push(lt_name);
             }
             names.sort();
index 231d84f37c5b2990bf35ff37c223e559336b1e87..e4636e1c7c6d721d32ae97faf60527cecf790bc5 100644 (file)
@@ -46,11 +46,11 @@ struct RH {
 
 fn setup_env(test_name: &str, source_string: &str) -> Env {
     let messages = @DVec();
-    let matches = getopts(vec!("-Z".to_owned(), "verbose".to_owned()), optgroups()).get();
+    let matches = getopts(vec!("-Z".to_string(), "verbose".to_string()), optgroups()).get();
     let diag = diagnostic::collect(messages);
-    let sessopts = build_session_options("rustc".to_owned(), &matches, diag);
+    let sessopts = build_session_options("rustc".to_string(), &matches, diag);
     let sess = build_session(sessopts, None, diag);
-    let cfg = build_configuration(sess, "whatever".to_owned(), str_input("".to_owned()));
+    let cfg = build_configuration(sess, "whatever".to_string(), str_input("".to_string()));
     let dm = HashMap();
     let amap = HashMap();
     let freevars = HashMap();
index 9043ffd10ba95da43bac03e0a2efa2c4e28ccc1e..625ee8f418caa930238f64ef8c5be1bfcc6ecce8 100644 (file)
@@ -198,7 +198,7 @@ fn path(w: &mut fmt::Formatter, path: &clean::Path, print_all: bool,
     let cache = cache_key.get().unwrap();
     let abs_root = root(&**cache, loc.as_slice());
     let rel_root = match path.segments.get(0).name.as_slice() {
-        "self" => Some("./".to_owned()),
+        "self" => Some("./".to_string()),
         _ => None,
     };
 
index f49b7f3e9890305daf71530384d89dee440ff27b..80caad84863727db90b172adc950908177226ff1 100644 (file)
@@ -197,7 +197,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
 
         // Extract the text provided
         let s = if text.is_null() {
-            "".to_owned()
+            "".to_string()
         } else {
             unsafe {
                 str::raw::from_buf_len((*text).data, (*text).size as uint)
index d601d2ae957feb5563a7d1cdd828fce5d0f629cc..ecbda89ee6101ed812ce582c0a01dc9b0becb48e 100644 (file)
@@ -378,7 +378,7 @@ pub fn run(mut krate: clean::Crate, dst: Path) -> io::IoResult<()> {
 
         try!(write!(&mut w, r"]\};"));
 
-        str::from_utf8(w.unwrap().as_slice()).unwrap().to_owned()
+        str::from_utf8(w.unwrap().as_slice()).unwrap().to_string()
     };
 
     // Write out the shared files. Note that these are shared among all rustdoc
@@ -1057,7 +1057,7 @@ fn href(&self) -> Option<String> {
         if ast_util::is_local(self.item.def_id) {
             let mut path = Vec::new();
             clean_srcpath(self.item.source.filename.as_bytes(), |component| {
-                path.push(component.to_owned());
+                path.push(component.to_string());
             });
             let href = if self.item.source.loline == self.item.source.hiline {
                 format!("{}", self.item.source.loline)
@@ -1087,7 +1087,7 @@ fn href(&self) -> Option<String> {
             let cache = cache_key.get().unwrap();
             let path = cache.external_paths.get(&self.item.def_id);
             let root = match *cache.extern_locations.get(&self.item.def_id.krate) {
-                Remote(ref s) => s.to_strbuf(),
+                Remote(ref s) => s.to_string(),
                 Local => format!("{}/..", self.cx.root_path),
                 Unknown => return None,
             };
index 390f81642e6b2092cbb045a238a9b5e6fe2f37f5..ea58f1f3fc6470adf414bc0b84e5dfa932e9a760 100644 (file)
@@ -346,14 +346,14 @@ mod unindent_tests {
 
     #[test]
     fn should_unindent() {
-        let s = "    line1\n    line2".to_owned();
+        let s = "    line1\n    line2".to_string();
         let r = unindent(s.as_slice());
         assert_eq!(r.as_slice(), "line1\nline2");
     }
 
     #[test]
     fn should_unindent_multiple_paragraphs() {
-        let s = "    line1\n\n    line2".to_owned();
+        let s = "    line1\n\n    line2".to_string();
         let r = unindent(s.as_slice());
         assert_eq!(r.as_slice(), "line1\n\nline2");
     }
@@ -362,7 +362,7 @@ fn should_unindent_multiple_paragraphs() {
     fn should_leave_multiple_indent_levels() {
         // Line 2 is indented another level beyond the
         // base indentation and should be preserved
-        let s = "    line1\n\n        line2".to_owned();
+        let s = "    line1\n\n        line2".to_string();
         let r = unindent(s.as_slice());
         assert_eq!(r.as_slice(), "line1\n\n    line2");
     }
@@ -374,14 +374,14 @@ fn should_ignore_first_line_indent() {
         //
         // #[doc = "Start way over here
         //          and continue here"]
-        let s = "line1\n    line2".to_owned();
+        let s = "line1\n    line2".to_string();
         let r = unindent(s.as_slice());
         assert_eq!(r.as_slice(), "line1\nline2");
     }
 
     #[test]
     fn should_not_ignore_first_line_indent_in_a_single_line_para() {
-        let s = "line1\n\n    line2".to_owned();
+        let s = "line1\n\n    line2".to_string();
         let r = unindent(s.as_slice());
         assert_eq!(r.as_slice(), "line1\n\n    line2");
     }
index 40244a67a4a71993b5572eb2d1da153135341688..b24e1f238b7755093e5f22ffd2e0d21002156c1b 100644 (file)
@@ -179,8 +179,8 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool,
 
         // Add the new dylib search path var
         let newpath = DynamicLibrary::create_path(path.as_slice());
-        env.push((var.to_owned(),
-                  str::from_utf8(newpath.as_slice()).unwrap().to_owned()));
+        env.push((var.to_string(),
+                  str::from_utf8(newpath.as_slice()).unwrap().to_string()));
         env
     };
     match Command::new(exe).env(env.as_slice()).output() {
@@ -265,7 +265,7 @@ pub fn add_test(&mut self, test: String, should_fail: bool, no_run: bool, should
         };
         self.cnt += 1;
         let libs = self.libs.clone();
-        let cratename = self.cratename.to_owned();
+        let cratename = self.cratename.to_string();
         let loose_feature_gating = self.loose_feature_gating;
         debug!("Creating test {}: {}", name, test);
         self.tests.push(testing::TestDescAndFn {
index 342a79057af1a4e6cad6c8c541f4aa1c53b61f24..fea473f35b4a1ee3b49fbdcb180768c40d63cd5d 100644 (file)
@@ -389,10 +389,10 @@ fn test_show() {
 
 #[test]
 fn test_to_str() {
-    assert_eq!(parse("1.2.3").unwrap().to_str(), "1.2.3".to_owned());
-    assert_eq!(parse("1.2.3-alpha1").unwrap().to_str(), "1.2.3-alpha1".to_owned());
-    assert_eq!(parse("1.2.3+build.42").unwrap().to_str(), "1.2.3+build.42".to_owned());
-    assert_eq!(parse("1.2.3-alpha1+42").unwrap().to_str(), "1.2.3-alpha1+42".to_owned());
+    assert_eq!(parse("1.2.3").unwrap().to_str(), "1.2.3".to_string());
+    assert_eq!(parse("1.2.3-alpha1").unwrap().to_str(), "1.2.3-alpha1".to_string());
+    assert_eq!(parse("1.2.3+build.42").unwrap().to_str(), "1.2.3+build.42".to_string());
+    assert_eq!(parse("1.2.3-alpha1+42").unwrap().to_str(), "1.2.3-alpha1+42".to_string());
 }
 
 #[test]
index 029f7162b42dfbc268267032a1322db7e680c7d5..983d76a08442bdb9885ad0eb812c7c340e39d950 100644 (file)
@@ -669,7 +669,7 @@ fn test_clone() {
     #[test]
     fn test_clone_noleak() {
         fn foo(f: |c: &CString|) {
-            let s = "test".to_owned();
+            let s = "test".to_string();
             let c = s.to_c_str();
             // give the closure a non-owned CString
             let mut c_ = c.with_ref(|c| unsafe { CString::new(c, false) } );
index 0952652498a3d69e1e557270e8a1daf89ac086da..174ea00d2862f1c776ab10a9c18155f66cef5f49 100644 (file)
 Some examples of the `format!` extension are:
 
 ```rust
-format!("Hello");                 // => "Hello".to_owned()
-format!("Hello, {:s}!", "world"); // => "Hello, world!".to_owned()
-format!("The number is {:d}", 1); // => "The number is 1".to_owned()
-format!("{:?}", ~[3, 4]);         // => "~[3, 4]".to_owned()
-format!("{value}", value=4);      // => "4".to_owned()
-format!("{} {}", 1, 2);           // => "1 2".to_owned()
+format!("Hello");                 // => "Hello".to_string()
+format!("Hello, {:s}!", "world"); // => "Hello, world!".to_string()
+format!("The number is {:d}", 1); // => "The number is 1".to_string()
+format!("{:?}", ~[3, 4]);         // => "~[3, 4]".to_string()
+format!("{value}", value=4);      // => "4".to_string()
+format!("{} {}", 1, 2);           // => "1 2".to_string()
 ```
 
 From these, you can see that the first argument is a format string. It is
@@ -62,7 +62,7 @@
 iterator advances. This leads to behavior like this:
 
 ```rust
-format!("{1} {} {0} {}", 1, 2); // => "2 1 1 2".to_owned()
+format!("{1} {} {0} {}", 1, 2); // => "2 1 1 2".to_string()
 ```
 
 The internal iterator over the argument has not been advanced by the time the
@@ -89,9 +89,9 @@
 For example, the following `format!` expressions all use named argument:
 
 ```rust
-format!("{argument}", argument = "test");       // => "test".to_owned()
-format!("{name} {}", 1, name = 2);              // => "2 1".to_owned()
-format!("{a:s} {c:d} {b:?}", a="a", b=(), c=3); // => "a 3 ()".to_owned()
+format!("{argument}", argument = "test");       // => "test".to_string()
+format!("{name} {}", 1, name = 2);              // => "2 1".to_string()
+format!("{a:s} {c:d} {b:?}", a="a", b=(), c=3); // => "a 3 ()".to_string()
 ```
 
 It is illegal to put positional parameters (those without names) after arguments
@@ -330,7 +330,7 @@ fn my_fmt_fn(args: &fmt::Arguments) {
 example:
 
 ```rust
-format!("{0, select, other{#}}", "hello"); // => "hello".to_owned()
+format!("{0, select, other{#}}", "hello"); // => "hello".to_string()
 ```
 
 This example is the equivalent of `{0:s}` essentially.
@@ -543,7 +543,7 @@ pub trait Poly {
 /// use std::fmt;
 ///
 /// let s = format_args!(fmt::format, "Hello, {}!", "world");
-/// assert_eq!(s, "Hello, world!".to_owned());
+/// assert_eq!(s, "Hello, world!".to_string());
 /// ```
 pub fn format(args: &Arguments) -> string::String{
     let mut output = io::MemWriter::new();
index 6ab65809a3ca835acca8630bffea9f3f31fee02a..8e95263d48e095adf6b5fe6e6333a58d44911dd0 100644 (file)
@@ -27,8 +27,8 @@
  *     phone: u64,
  * }
  *
- * let person1 = Person { id: 5, name: "Janet".to_owned(), phone: 555_666_7777 };
- * let person2 = Person { id: 5, name: "Bob".to_owned(), phone: 555_666_7777 };
+ * let person1 = Person { id: 5, name: "Janet".to_string(), phone: 555_666_7777 };
+ * let person2 = Person { id: 5, name: "Bob".to_string(), phone: 555_666_7777 };
  *
  * assert!(hash::hash(&person1) != hash::hash(&person2));
  * ```
@@ -54,8 +54,8 @@
  *     }
  * }
  *
- * let person1 = Person { id: 5, name: "Janet".to_owned(), phone: 555_666_7777 };
- * let person2 = Person { id: 5, name: "Bob".to_owned(), phone: 555_666_7777 };
+ * let person1 = Person { id: 5, name: "Janet".to_string(), phone: 555_666_7777 };
+ * let person2 = Person { id: 5, name: "Bob".to_string(), phone: 555_666_7777 };
  *
  * assert!(hash::hash(&person1) == hash::hash(&person2));
  * ```
index c22bc92fb65b59a9b6fa8607af6c3867b525cd37..c16c77373575b01e6f40c9e2c0b48e4ba78f1583 100644 (file)
@@ -1315,7 +1315,7 @@ pub trait Buffer: Reader {
     /// use std::io;
     ///
     /// let mut reader = io::stdin();
-    /// let input = reader.read_line().ok().unwrap_or("nothing".to_owned());
+    /// let input = reader.read_line().ok().unwrap_or("nothing".to_string());
     /// ```
     ///
     /// # Error
index e1242e24537572d4d4c183d2d8bb2212ce4ab25a..ca75f33f0fe327530c92b3fcdaf491d4069e5fda 100644 (file)
@@ -396,7 +396,7 @@ pub trait OwnedVector<T> {
     /// # Examples
     ///
     /// ```rust
-    /// let v = ~["a".to_owned(), "b".to_owned()];
+    /// let v = ~["a".to_string(), "b".to_string()];
     /// for s in v.move_iter() {
     ///   // s has type ~str, not &~str
     ///   println!("{}", s);
@@ -1186,7 +1186,7 @@ fn test_permutations() {
             assert_eq!(it.next(), None);
         }
         {
-            let v = ["Hello".to_owned()];
+            let v = ["Hello".to_string()];
             let mut it = v.permutations();
             let (min_size, max_opt) = it.size_hint();
             assert_eq!(min_size, 1);
index b57c329983ea98b97e4ea3d47bbb1b398b838b14..988c029c9b9321ae2f99814f7d0d5fd7a81e049a 100644 (file)
@@ -330,7 +330,7 @@ pub fn replace(s: &str, from: &str, to: &str) -> String {
 /// // 𝄞music
 /// let mut v = [0xD834, 0xDD1E, 0x006d, 0x0075,
 ///              0x0073, 0x0069, 0x0063];
-/// assert_eq!(str::from_utf16(v), Some("𝄞music".to_owned()));
+/// assert_eq!(str::from_utf16(v), Some("𝄞music".to_string()));
 ///
 /// // 𝄞mu<invalid>ic
 /// v[4] = 0xD800;
@@ -360,7 +360,7 @@ pub fn from_utf16(v: &[u16]) -> Option<String> {
 ///          0xD834];
 ///
 /// assert_eq!(str::from_utf16_lossy(v),
-///            "𝄞mus\uFFFDic\uFFFD".to_owned());
+///            "𝄞mus\uFFFDic\uFFFD".to_string());
 /// ```
 pub fn from_utf16_lossy(v: &[u16]) -> String {
     utf16_items(v).map(|c| c.to_char_lossy()).collect()
@@ -609,7 +609,7 @@ impl<'a> StrAllocating for MaybeOwned<'a> {
     #[inline]
     fn into_owned(self) -> String {
         match self {
-            Slice(s) => s.to_owned(),
+            Slice(s) => s.to_string(),
             Owned(s) => s
         }
     }
@@ -625,7 +625,7 @@ impl<'a> Clone for MaybeOwned<'a> {
     fn clone(&self) -> MaybeOwned<'a> {
         match *self {
             Slice(s) => Slice(s),
-            Owned(ref s) => Owned(s.to_owned())
+            Owned(ref s) => Owned(s.to_string())
         }
     }
 }
@@ -710,7 +710,7 @@ fn test_from_buf_len() {
             let a = ~[65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 0u8];
             let b = a.as_ptr();
             let c = from_buf_len(b, 3u);
-            assert_eq!(c, "AAA".to_owned());
+            assert_eq!(c, "AAA".to_string());
         }
     }
 }
@@ -771,11 +771,11 @@ fn escape_unicode(&self) -> String {
     ///
     /// ```rust
     /// let s = "Do you know the muffin man,
-    /// The muffin man, the muffin man, ...".to_owned();
+    /// The muffin man, the muffin man, ...".to_string();
     ///
     /// assert_eq!(s.replace("muffin man", "little lamb"),
     ///            "Do you know the little lamb,
-    /// The little lamb, the little lamb, ...".to_owned());
+    /// The little lamb, the little lamb, ...".to_string());
     ///
     /// // not found, so no change.
     /// assert_eq!(s.replace("cookie monster", "little lamb"), s);
@@ -793,7 +793,8 @@ fn replace(&self, from: &str, to: &str) -> String {
         result
     }
 
-    /// Copy a slice into a new `String`.
+    #[allow(missing_doc)]
+    #[deprecated = "obsolete, use `to_string`"]
     #[inline]
     fn to_owned(&self) -> String {
         use slice::Vector;
@@ -888,7 +889,7 @@ fn nfkd_chars<'a>(&'a self) -> Decompositions<'a> {
 impl<'a> StrAllocating for &'a str {
     #[inline]
     fn into_owned(self) -> String {
-        self.to_owned()
+        self.to_string()
     }
 }
 
@@ -981,17 +982,17 @@ fn test_rfind() {
 
     #[test]
     fn test_collect() {
-        let empty = "".to_owned();
+        let empty = "".to_string();
         let s: String = empty.as_slice().chars().collect();
         assert_eq!(empty, s);
-        let data = "ประเทศไทย中".to_owned();
+        let data = "ประเทศไทย中".to_string();
         let s: String = data.as_slice().chars().collect();
         assert_eq!(data, s);
     }
 
     #[test]
     fn test_into_bytes() {
-        let data = "asdf".to_owned();
+        let data = "asdf".to_string();
         let buf = data.into_bytes();
         assert_eq!(bytes!("asdf"), buf.as_slice());
     }
@@ -1045,11 +1046,11 @@ fn test_concat() {
         fn t(v: &[String], s: &str) {
             assert_eq!(v.concat(), s.to_str().into_owned());
         }
-        t(["you".to_owned(), "know".to_owned(), "I'm".to_owned(),
-          "no".to_owned(), "good".to_owned()], "youknowI'mnogood");
+        t(["you".to_string(), "know".to_string(), "I'm".to_string(),
+          "no".to_string(), "good".to_string()], "youknowI'mnogood");
         let v: &[String] = [];
         t(v, "");
-        t(["hi".to_owned()], "hi");
+        t(["hi".to_string()], "hi");
     }
 
     #[test]
@@ -1057,12 +1058,12 @@ fn test_connect() {
         fn t(v: &[String], sep: &str, s: &str) {
             assert_eq!(v.connect(sep), s.to_str().into_owned());
         }
-        t(["you".to_owned(), "know".to_owned(), "I'm".to_owned(),
-           "no".to_owned(), "good".to_owned()],
+        t(["you".to_string(), "know".to_string(), "I'm".to_string(),
+           "no".to_string(), "good".to_string()],
           " ", "you know I'm no good");
         let v: &[String] = [];
         t(v, " ", "");
-        t(["hi".to_owned()], " ", "hi");
+        t(["hi".to_string()], " ", "hi");
     }
 
     #[test]
@@ -1089,11 +1090,11 @@ fn t(v: &[&str], sep: &str, s: &str) {
 
     #[test]
     fn test_repeat() {
-        assert_eq!("x".repeat(4), "xxxx".to_owned());
-        assert_eq!("hi".repeat(4), "hihihihi".to_owned());
-        assert_eq!("ไท华".repeat(3), "ไท华ไท华ไท华".to_owned());
-        assert_eq!("".repeat(4), "".to_owned());
-        assert_eq!("hi".repeat(0), "".to_owned());
+        assert_eq!("x".repeat(4), "xxxx".to_string());
+        assert_eq!("hi".repeat(4), "hihihihi".to_string());
+        assert_eq!("ไท华".repeat(3), "ไท华ไท华ไท华".to_string());
+        assert_eq!("".repeat(4), "".to_string());
+        assert_eq!("hi".repeat(0), "".to_string());
     }
 
     #[test]
@@ -1157,13 +1158,13 @@ fn test_is_empty() {
     #[test]
     fn test_replace() {
         let a = "a";
-        assert_eq!("".replace(a, "b"), "".to_owned());
-        assert_eq!("a".replace(a, "b"), "b".to_owned());
-        assert_eq!("ab".replace(a, "b"), "bb".to_owned());
+        assert_eq!("".replace(a, "b"), "".to_string());
+        assert_eq!("a".replace(a, "b"), "b".to_string());
+        assert_eq!("ab".replace(a, "b"), "bb".to_string());
         let test = "test";
         assert!(" test test ".replace(test, "toast") ==
-            " toast toast ".to_owned());
-        assert_eq!(" test test ".replace(test, ""), "   ".to_owned());
+            " toast toast ".to_string());
+        assert_eq!(" test test ".replace(test, ""), "   ".to_string());
     }
 
     #[test]
@@ -1466,7 +1467,7 @@ fn test_raw_from_c_str() {
             let a = box [65, 65, 65, 65, 65, 65, 65, 0];
             let b = a.as_ptr();
             let c = raw::from_c_str(b);
-            assert_eq!(c, "AAAAAAA".to_owned());
+            assert_eq!(c, "AAAAAAA".to_string());
         }
     }
 
@@ -1488,7 +1489,7 @@ fn test_as_bytes() {
     fn test_as_bytes_fail() {
         // Don't double free. (I'm not sure if this exercises the
         // original problem code path anymore.)
-        let s = "".to_owned();
+        let s = "".to_string();
         let _bytes = s.as_bytes();
         fail!();
     }
@@ -1577,13 +1578,13 @@ fn test_contains_char() {
     #[test]
     fn test_utf16() {
         let pairs =
-            [("𐍅𐌿𐌻𐍆𐌹𐌻𐌰\n".to_owned(),
+            [("𐍅𐌿𐌻𐍆𐌹𐌻𐌰\n".to_string(),
               vec![0xd800_u16, 0xdf45_u16, 0xd800_u16, 0xdf3f_u16,
                 0xd800_u16, 0xdf3b_u16, 0xd800_u16, 0xdf46_u16,
                 0xd800_u16, 0xdf39_u16, 0xd800_u16, 0xdf3b_u16,
                 0xd800_u16, 0xdf30_u16, 0x000a_u16]),
 
-             ("𐐒𐑉𐐮𐑀𐐲𐑋 𐐏𐐲𐑍\n".to_owned(),
+             ("𐐒𐑉𐐮𐑀𐐲𐑋 𐐏𐐲𐑍\n".to_string(),
               vec![0xd801_u16, 0xdc12_u16, 0xd801_u16,
                 0xdc49_u16, 0xd801_u16, 0xdc2e_u16, 0xd801_u16,
                 0xdc40_u16, 0xd801_u16, 0xdc32_u16, 0xd801_u16,
@@ -1591,7 +1592,7 @@ fn test_utf16() {
                 0xd801_u16, 0xdc32_u16, 0xd801_u16, 0xdc4d_u16,
                 0x000a_u16]),
 
-             ("𐌀𐌖𐌋𐌄𐌑𐌉·𐌌𐌄𐌕𐌄𐌋𐌉𐌑\n".to_owned(),
+             ("𐌀𐌖𐌋𐌄𐌑𐌉·𐌌𐌄𐌕𐌄𐌋𐌉𐌑\n".to_string(),
               vec![0xd800_u16, 0xdf00_u16, 0xd800_u16, 0xdf16_u16,
                 0xd800_u16, 0xdf0b_u16, 0xd800_u16, 0xdf04_u16,
                 0xd800_u16, 0xdf11_u16, 0xd800_u16, 0xdf09_u16,
@@ -1600,7 +1601,7 @@ fn test_utf16() {
                 0xdf04_u16, 0xd800_u16, 0xdf0b_u16, 0xd800_u16,
                 0xdf09_u16, 0xd800_u16, 0xdf11_u16, 0x000a_u16 ]),
 
-             ("𐒋𐒘𐒈𐒑𐒛𐒒 𐒕𐒓 𐒈𐒚𐒍 𐒏𐒜𐒒𐒖𐒆 𐒕𐒆\n".to_owned(),
+             ("𐒋𐒘𐒈𐒑𐒛𐒒 𐒕𐒓 𐒈𐒚𐒍 𐒏𐒜𐒒𐒖𐒆 𐒕𐒆\n".to_string(),
               vec![0xd801_u16, 0xdc8b_u16, 0xd801_u16, 0xdc98_u16,
                 0xd801_u16, 0xdc88_u16, 0xd801_u16, 0xdc91_u16,
                 0xd801_u16, 0xdc9b_u16, 0xd801_u16, 0xdc92_u16,
@@ -1613,7 +1614,7 @@ fn test_utf16() {
                 0xd801_u16, 0xdc95_u16, 0xd801_u16, 0xdc86_u16,
                 0x000a_u16 ]),
              // Issue #12318, even-numbered non-BMP planes
-             ("\U00020000".to_owned(),
+             ("\U00020000".to_string(),
               vec![0xD840, 0xDC00])];
 
         for p in pairs.iter() {
@@ -1648,15 +1649,16 @@ fn test_utf16_invalid() {
     fn test_utf16_lossy() {
         // completely positive cases tested above.
         // lead + eof
-        assert_eq!(from_utf16_lossy([0xD800]), "\uFFFD".to_owned());
+        assert_eq!(from_utf16_lossy([0xD800]), "\uFFFD".to_string());
         // lead + lead
-        assert_eq!(from_utf16_lossy([0xD800, 0xD800]), "\uFFFD\uFFFD".to_owned());
+        assert_eq!(from_utf16_lossy([0xD800, 0xD800]), "\uFFFD\uFFFD".to_string());
 
         // isolated trail
-        assert_eq!(from_utf16_lossy([0x0061, 0xDC00]), "a\uFFFD".to_owned());
+        assert_eq!(from_utf16_lossy([0x0061, 0xDC00]), "a\uFFFD".to_string());
 
         // general
-        assert_eq!(from_utf16_lossy([0xD800, 0xd801, 0xdc8b, 0xD800]), "\uFFFD𐒋\uFFFD".to_owned());
+        assert_eq!(from_utf16_lossy([0xD800, 0xd801, 0xdc8b, 0xD800]),
+                   "\uFFFD𐒋\uFFFD".to_string());
     }
 
     #[test]
@@ -1701,27 +1703,27 @@ fn test_char_at_reverse() {
 
     #[test]
     fn test_escape_unicode() {
-        assert_eq!("abc".escape_unicode(), "\\x61\\x62\\x63".to_owned());
-        assert_eq!("a c".escape_unicode(), "\\x61\\x20\\x63".to_owned());
-        assert_eq!("\r\n\t".escape_unicode(), "\\x0d\\x0a\\x09".to_owned());
-        assert_eq!("'\"\\".escape_unicode(), "\\x27\\x22\\x5c".to_owned());
-        assert_eq!("\x00\x01\xfe\xff".escape_unicode(), "\\x00\\x01\\xfe\\xff".to_owned());
-        assert_eq!("\u0100\uffff".escape_unicode(), "\\u0100\\uffff".to_owned());
-        assert_eq!("\U00010000\U0010ffff".escape_unicode(), "\\U00010000\\U0010ffff".to_owned());
-        assert_eq!("ab\ufb00".escape_unicode(), "\\x61\\x62\\ufb00".to_owned());
-        assert_eq!("\U0001d4ea\r".escape_unicode(), "\\U0001d4ea\\x0d".to_owned());
+        assert_eq!("abc".escape_unicode(), "\\x61\\x62\\x63".to_string());
+        assert_eq!("a c".escape_unicode(), "\\x61\\x20\\x63".to_string());
+        assert_eq!("\r\n\t".escape_unicode(), "\\x0d\\x0a\\x09".to_string());
+        assert_eq!("'\"\\".escape_unicode(), "\\x27\\x22\\x5c".to_string());
+        assert_eq!("\x00\x01\xfe\xff".escape_unicode(), "\\x00\\x01\\xfe\\xff".to_string());
+        assert_eq!("\u0100\uffff".escape_unicode(), "\\u0100\\uffff".to_string());
+        assert_eq!("\U00010000\U0010ffff".escape_unicode(), "\\U00010000\\U0010ffff".to_string());
+        assert_eq!("ab\ufb00".escape_unicode(), "\\x61\\x62\\ufb00".to_string());
+        assert_eq!("\U0001d4ea\r".escape_unicode(), "\\U0001d4ea\\x0d".to_string());
     }
 
     #[test]
     fn test_escape_default() {
-        assert_eq!("abc".escape_default(), "abc".to_owned());
-        assert_eq!("a c".escape_default(), "a c".to_owned());
-        assert_eq!("\r\n\t".escape_default(), "\\r\\n\\t".to_owned());
-        assert_eq!("'\"\\".escape_default(), "\\'\\\"\\\\".to_owned());
-        assert_eq!("\u0100\uffff".escape_default(), "\\u0100\\uffff".to_owned());
-        assert_eq!("\U00010000\U0010ffff".escape_default(), "\\U00010000\\U0010ffff".to_owned());
-        assert_eq!("ab\ufb00".escape_default(), "ab\\ufb00".to_owned());
-        assert_eq!("\U0001d4ea\r".escape_default(), "\\U0001d4ea\\r".to_owned());
+        assert_eq!("abc".escape_default(), "abc".to_string());
+        assert_eq!("a c".escape_default(), "a c".to_string());
+        assert_eq!("\r\n\t".escape_default(), "\\r\\n\\t".to_string());
+        assert_eq!("'\"\\".escape_default(), "\\'\\\"\\\\".to_string());
+        assert_eq!("\u0100\uffff".escape_default(), "\\u0100\\uffff".to_string());
+        assert_eq!("\U00010000\U0010ffff".escape_default(), "\\U00010000\\U0010ffff".to_string());
+        assert_eq!("ab\ufb00".escape_default(), "ab\\ufb00".to_string());
+        assert_eq!("\U0001d4ea\r".escape_default(), "\\U0001d4ea\\r".to_string());
     }
 
     #[test]
@@ -2043,9 +2045,10 @@ fn sum_len<S: Container>(v: &[S]) -> uint {
             v.iter().map(|x| x.len()).sum()
         }
 
-        let s = "01234".to_owned();
+        let s = "01234".to_string();
         assert_eq!(5, sum_len(["012", "", "34"]));
-        assert_eq!(5, sum_len(["01".to_owned(), "2".to_owned(), "34".to_owned(), "".to_owned()]));
+        assert_eq!(5, sum_len(["01".to_string(), "2".to_string(),
+                               "34".to_string(), "".to_string()]));
         assert_eq!(5, sum_len([s.as_slice()]));
     }
 
@@ -2064,10 +2067,10 @@ fn test_str_from_utf8() {
     #[test]
     fn test_str_from_utf8_owned() {
         let xs = Vec::from_slice(bytes!("hello"));
-        assert_eq!(from_utf8_owned(xs), Ok("hello".to_owned()));
+        assert_eq!(from_utf8_owned(xs), Ok("hello".to_string()));
 
         let xs = Vec::from_slice(bytes!("ศไทย中华Việt Nam"));
-        assert_eq!(from_utf8_owned(xs), Ok("ศไทย中华Việt Nam".to_owned()));
+        assert_eq!(from_utf8_owned(xs), Ok("ศไทย中华Việt Nam".to_string()));
 
         let xs = Vec::from_slice(bytes!("hello", 0xff));
         assert_eq!(from_utf8_owned(xs),
@@ -2083,28 +2086,28 @@ fn test_str_from_utf8_lossy() {
         assert_eq!(from_utf8_lossy(xs), Slice("ศไทย中华Việt Nam"));
 
         let xs = bytes!("Hello", 0xC2, " There", 0xFF, " Goodbye");
-        assert_eq!(from_utf8_lossy(xs), Owned("Hello\uFFFD There\uFFFD Goodbye".to_owned()));
+        assert_eq!(from_utf8_lossy(xs), Owned("Hello\uFFFD There\uFFFD Goodbye".to_string()));
 
         let xs = bytes!("Hello", 0xC0, 0x80, " There", 0xE6, 0x83, " Goodbye");
-        assert_eq!(from_utf8_lossy(xs), Owned("Hello\uFFFD\uFFFD There\uFFFD Goodbye".to_owned()));
+        assert_eq!(from_utf8_lossy(xs), Owned("Hello\uFFFD\uFFFD There\uFFFD Goodbye".to_string()));
 
         let xs = bytes!(0xF5, "foo", 0xF5, 0x80, "bar");
-        assert_eq!(from_utf8_lossy(xs), Owned("\uFFFDfoo\uFFFD\uFFFDbar".to_owned()));
+        assert_eq!(from_utf8_lossy(xs), Owned("\uFFFDfoo\uFFFD\uFFFDbar".to_string()));
 
         let xs = bytes!(0xF1, "foo", 0xF1, 0x80, "bar", 0xF1, 0x80, 0x80, "baz");
-        assert_eq!(from_utf8_lossy(xs), Owned("\uFFFDfoo\uFFFDbar\uFFFDbaz".to_owned()));
+        assert_eq!(from_utf8_lossy(xs), Owned("\uFFFDfoo\uFFFDbar\uFFFDbaz".to_string()));
 
         let xs = bytes!(0xF4, "foo", 0xF4, 0x80, "bar", 0xF4, 0xBF, "baz");
-        assert_eq!(from_utf8_lossy(xs), Owned("\uFFFDfoo\uFFFDbar\uFFFD\uFFFDbaz".to_owned()));
+        assert_eq!(from_utf8_lossy(xs), Owned("\uFFFDfoo\uFFFDbar\uFFFD\uFFFDbaz".to_string()));
 
         let xs = bytes!(0xF0, 0x80, 0x80, 0x80, "foo", 0xF0, 0x90, 0x80, 0x80, "bar");
         assert_eq!(from_utf8_lossy(xs), Owned("\uFFFD\uFFFD\uFFFD\uFFFD\
-                                               foo\U00010000bar".to_owned()));
+                                               foo\U00010000bar".to_string()));
 
         // surrogates
         let xs = bytes!(0xED, 0xA0, 0x80, "foo", 0xED, 0xBF, 0xBF, "bar");
         assert_eq!(from_utf8_lossy(xs), Owned("\uFFFD\uFFFD\uFFFDfoo\
-                                               \uFFFD\uFFFD\uFFFDbar".to_owned()));
+                                               \uFFFD\uFFFD\uFFFDbar".to_string()));
     }
 
     #[test]
@@ -2118,18 +2121,18 @@ fn test_maybe_owned_traits() {
         let s = Slice("abcde");
         assert_eq!(s.len(), 5);
         assert_eq!(s.as_slice(), "abcde");
-        assert_eq!(s.to_str(), "abcde".to_strbuf());
-        assert_eq!(format_strbuf!("{}", s), "abcde".to_strbuf());
-        assert!(s.lt(&Owned("bcdef".to_owned())));
+        assert_eq!(s.to_str(), "abcde".to_string());
+        assert_eq!(format_strbuf!("{}", s), "abcde".to_string());
+        assert!(s.lt(&Owned("bcdef".to_string())));
         assert_eq!(Slice(""), Default::default());
 
-        let o = Owned("abcde".to_owned());
+        let o = Owned("abcde".to_string());
         assert_eq!(o.len(), 5);
         assert_eq!(o.as_slice(), "abcde");
         assert_eq!(o.to_str(), "abcde".to_strbuf());
         assert_eq!(format_strbuf!("{}", o), "abcde".to_strbuf());
         assert!(o.lt(&Slice("bcdef")));
-        assert_eq!(Owned("".to_owned()), Default::default());
+        assert_eq!(Owned("".to_string()), Default::default());
 
         assert!(s.cmp(&o) == Equal);
         assert!(s.equiv(&o));
@@ -2144,31 +2147,31 @@ fn test_maybe_owned_methods() {
         assert!(s.is_slice());
         assert!(!s.is_owned());
 
-        let o = Owned("abcde".to_owned());
+        let o = Owned("abcde".to_string());
         assert!(!o.is_slice());
         assert!(o.is_owned());
     }
 
     #[test]
     fn test_maybe_owned_clone() {
-        assert_eq!(Owned("abcde".to_owned()), Slice("abcde").clone());
-        assert_eq!(Owned("abcde".to_owned()), Owned("abcde".to_owned()).clone());
+        assert_eq!(Owned("abcde".to_string()), Slice("abcde").clone());
+        assert_eq!(Owned("abcde".to_string()), Owned("abcde".to_string()).clone());
         assert_eq!(Slice("abcde"), Slice("abcde").clone());
-        assert_eq!(Slice("abcde"), Owned("abcde".to_owned()).clone());
+        assert_eq!(Slice("abcde"), Owned("abcde".to_string()).clone());
     }
 
     #[test]
     fn test_maybe_owned_into_owned() {
-        assert_eq!(Slice("abcde").into_owned(), "abcde".to_owned());
-        assert_eq!(Owned("abcde".to_owned()).into_owned(), "abcde".to_owned());
+        assert_eq!(Slice("abcde").into_owned(), "abcde".to_string());
+        assert_eq!(Owned("abcde".to_string()).into_owned(), "abcde".to_string());
     }
 
     #[test]
     fn test_into_maybe_owned() {
         assert_eq!("abcde".into_maybe_owned(), Slice("abcde"));
-        assert_eq!(("abcde".to_owned()).into_maybe_owned(), Slice("abcde"));
-        assert_eq!("abcde".into_maybe_owned(), Owned("abcde".to_owned()));
-        assert_eq!(("abcde".to_owned()).into_maybe_owned(), Owned("abcde".to_owned()));
+        assert_eq!(("abcde".to_string()).into_maybe_owned(), Slice("abcde"));
+        assert_eq!("abcde".into_maybe_owned(), Owned("abcde".to_string()));
+        assert_eq!(("abcde".to_string()).into_maybe_owned(), Owned("abcde".to_string()));
     }
 }
 
index 078883aac13ed579d4403bbd1b57c1ba43080e4d..37244b26ad5965c4984afda3e9077d81a0d35c1d 100644 (file)
@@ -295,7 +295,7 @@ fn test_unnamed_task() {
 
 #[test]
 fn test_owned_named_task() {
-    TaskBuilder::new().named("ada lovelace".to_owned()).spawn(proc() {
+    TaskBuilder::new().named("ada lovelace".to_string()).spawn(proc() {
         with_task_name(|name| {
             assert!(name.unwrap() == "ada lovelace");
         })
@@ -367,7 +367,7 @@ fn test_back_to_the_future_result() {
 #[test]
 fn test_try_success() {
     match try(proc() {
-        "Success!".to_owned()
+        "Success!".to_string()
     }).as_ref().map(|s| s.as_slice()) {
         result::Ok("Success!") => (),
         _ => fail!()
index 3c1e83e1b544f39d50bc33bdce3ecdbb40631453..24330584714fa964fbb6d9d2308eeafaa4325030 100644 (file)
@@ -669,7 +669,7 @@ pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T] {
     /// # Example
     ///
     /// ```rust
-    /// let v = vec!("a".to_owned(), "b".to_owned());
+    /// let v = vec!("a".to_string(), "b".to_string());
     /// for s in v.move_iter() {
     ///     // s has type String, not &String
     ///     println!("{}", s);
@@ -874,13 +874,14 @@ pub fn mut_last<'a>(&'a mut self) -> Option<&'a mut T> {
     ///
     /// # Example
     /// ```rust
-    /// let mut v = vec!("foo".to_owned(), "bar".to_owned(), "baz".to_owned(), "qux".to_owned());
+    /// let mut v = vec!("foo".to_string(), "bar".to_string(),
+    ///                  "baz".to_string(), "qux".to_string());
     ///
-    /// assert_eq!(v.swap_remove(1), Some("bar".to_owned()));
-    /// assert_eq!(v, vec!("foo".to_owned(), "qux".to_owned(), "baz".to_owned()));
+    /// assert_eq!(v.swap_remove(1), Some("bar".to_string()));
+    /// assert_eq!(v, vec!("foo".to_string(), "qux".to_string(), "baz".to_string()));
     ///
-    /// assert_eq!(v.swap_remove(0), Some("foo".to_owned()));
-    /// assert_eq!(v, vec!("baz".to_owned(), "qux".to_owned()));
+    /// assert_eq!(v.swap_remove(0), Some("foo".to_string()));
+    /// assert_eq!(v, vec!("baz".to_string(), "qux".to_string()));
     ///
     /// assert_eq!(v.swap_remove(2), None);
     /// ```
index 6cc98cd69cafc927cd194b18e52a6e1a7ee5b96f..eefa4da82a1c361dbc2c4b36397f5bf4a6b702be 100644 (file)
@@ -60,10 +60,10 @@ mod test {
     pub fn DuplexStream1() {
         let (left, right) = duplex();
 
-        left.send("abc".to_owned());
+        left.send("abc".to_string());
         right.send(123);
 
         assert!(left.recv() == 123);
-        assert!(right.recv() == "abc".to_owned());
+        assert!(right.recv() == "abc".to_string());
     }
 }
index a854d44aab0f6683e9e7bbafb83ee832bfe85c94..0ce19e8f00a58aa83aa976dbd9278b2dfadf265e 100644 (file)
@@ -143,34 +143,34 @@ mod test {
 
     #[test]
     fn test_from_value() {
-        let mut f = Future::from_value("snail".to_owned());
-        assert_eq!(f.get(), "snail".to_owned());
+        let mut f = Future::from_value("snail".to_string());
+        assert_eq!(f.get(), "snail".to_string());
     }
 
     #[test]
     fn test_from_receiver() {
         let (tx, rx) = channel();
-        tx.send("whale".to_owned());
+        tx.send("whale".to_string());
         let mut f = Future::from_receiver(rx);
-        assert_eq!(f.get(), "whale".to_owned());
+        assert_eq!(f.get(), "whale".to_string());
     }
 
     #[test]
     fn test_from_fn() {
-        let mut f = Future::from_fn(proc() "brail".to_owned());
-        assert_eq!(f.get(), "brail".to_owned());
+        let mut f = Future::from_fn(proc() "brail".to_string());
+        assert_eq!(f.get(), "brail".to_string());
     }
 
     #[test]
     fn test_interface_get() {
-        let mut f = Future::from_value("fail".to_owned());
-        assert_eq!(f.get(), "fail".to_owned());
+        let mut f = Future::from_value("fail".to_string());
+        assert_eq!(f.get(), "fail".to_string());
     }
 
     #[test]
     fn test_interface_unwrap() {
-        let f = Future::from_value("fail".to_owned());
-        assert_eq!(f.unwrap(), "fail".to_owned());
+        let f = Future::from_value("fail".to_string());
+        assert_eq!(f.unwrap(), "fail".to_string());
     }
 
     #[test]
@@ -181,8 +181,8 @@ fn test_get_ref_method() {
 
     #[test]
     fn test_spawn() {
-        let mut f = Future::spawn(proc() "bale".to_owned());
-        assert_eq!(f.get(), "bale".to_owned());
+        let mut f = Future::spawn(proc() "bale".to_string());
+        assert_eq!(f.get(), "bale".to_string());
     }
 
     #[test]
index 06b3ed91a5a18e04208ef0da069745f81b78639a..fea165eb2ceb2eb90f406412043f7dbe67cec040 100644 (file)
@@ -52,7 +52,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 impl FromStr for CrateId {
     fn from_str(s: &str) -> Option<CrateId> {
         let pieces: Vec<&str> = s.splitn('#', 1).collect();
-        let path = pieces.get(0).to_owned();
+        let path = pieces.get(0).to_string();
 
         if path.as_slice().starts_with("/") || path.as_slice().ends_with("/") ||
             path.as_slice().starts_with(".") || path.is_empty() {
index 822084df2f607915c405503bdeb3466388981b73..06916d5ac098aef90ba903b2ba2fa29e6a832304 100644 (file)
@@ -57,7 +57,7 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
     let mut asm_str_style = None;
     let mut outputs = Vec::new();
     let mut inputs = Vec::new();
-    let mut cons = "".to_owned();
+    let mut cons = "".to_string();
     let mut volatile = false;
     let mut alignstack = false;
     let mut dialect = ast::AsmAtt;
index b8a3eea0014a0717536a1956afc6bccb93144089..d6b7e84b5355d64cd6a570535e76c73a50144482 100644 (file)
@@ -36,7 +36,7 @@ impl<D:Decoder> Decodable for node_id {
     fn decode(d: &D) -> Node {
         d.read_struct("Node", 1, || {
             Node {
-                id: d.read_field("x".to_owned(), 0, || decode(d))
+                id: d.read_field("x".to_string(), 0, || decode(d))
             }
         })
     }
@@ -73,8 +73,8 @@ impl<
         fn decode(d: &D) -> spanned<T> {
             d.read_rec(|| {
                 {
-                    node: d.read_field("node".to_owned(), 0, || decode(d)),
-                    span: d.read_field("span".to_owned(), 1, || decode(d)),
+                    node: d.read_field("node".to_string(), 0, || decode(d)),
+                    span: d.read_field("span".to_string(), 1, || decode(d)),
                 }
             })
         }
index 5f3306318191f5e0f54a4915949bcc80bcb76bf1..ce8ada7071b3b4df60711326f5133830aa699ab2 100644 (file)
@@ -430,11 +430,11 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 
         LIT_INT(i, ity) => {
             let s_ity = match ity {
-                ast::TyI => "TyI".to_owned(),
-                ast::TyI8 => "TyI8".to_owned(),
-                ast::TyI16 => "TyI16".to_owned(),
-                ast::TyI32 => "TyI32".to_owned(),
-                ast::TyI64 => "TyI64".to_owned()
+                ast::TyI => "TyI".to_string(),
+                ast::TyI8 => "TyI8".to_string(),
+                ast::TyI16 => "TyI16".to_string(),
+                ast::TyI32 => "TyI32".to_string(),
+                ast::TyI64 => "TyI64".to_string()
             };
             let e_ity = cx.expr_ident(sp, id_ext(s_ity.as_slice()));
 
@@ -447,11 +447,11 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 
         LIT_UINT(u, uty) => {
             let s_uty = match uty {
-                ast::TyU => "TyU".to_owned(),
-                ast::TyU8 => "TyU8".to_owned(),
-                ast::TyU16 => "TyU16".to_owned(),
-                ast::TyU32 => "TyU32".to_owned(),
-                ast::TyU64 => "TyU64".to_owned()
+                ast::TyU => "TyU".to_string(),
+                ast::TyU8 => "TyU8".to_string(),
+                ast::TyU16 => "TyU16".to_string(),
+                ast::TyU32 => "TyU32".to_string(),
+                ast::TyU64 => "TyU64".to_string()
             };
             let e_uty = cx.expr_ident(sp, id_ext(s_uty.as_slice()));
 
@@ -472,9 +472,9 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 
         LIT_FLOAT(fident, fty) => {
             let s_fty = match fty {
-                ast::TyF32 => "TyF32".to_owned(),
-                ast::TyF64 => "TyF64".to_owned(),
-                ast::TyF128 => "TyF128".to_owned()
+                ast::TyF32 => "TyF32".to_string(),
+                ast::TyF64 => "TyF64".to_string(),
+                ast::TyF128 => "TyF128".to_string()
             };
             let e_fty = cx.expr_ident(sp, id_ext(s_fty.as_slice()));
 
index ae5f16c2580e2c920d6aa4027e44cbd4e01285ba..b5ddd6cd20f74270bd3e54b19408ad8ffa6ab800 100644 (file)
@@ -4159,7 +4159,7 @@ fn eval_src_mod(&mut self,
                 outer_attrs, "path") {
             Some(d) => (dir_path.join(d), true),
             None => {
-                let mod_name = mod_string.get().to_owned();
+                let mod_name = mod_string.get().to_string();
                 let default_path_str = format!("{}.rs", mod_name);
                 let secondary_path_str = format!("{}/mod.rs", mod_name);
                 let default_path = dir_path.join(default_path_str.as_slice());
index 5625a14a4f25527585032e900468bfa1d3e1d853..33589f29624f0f5ede49c0b35da7324ca0b79168 100644 (file)
@@ -217,7 +217,7 @@ macro_rules! try( ($e:expr) => (
     // don't read NUL
     let bytes = try!(file.read_exact(names_bytes as uint - 1));
     let names_str = match str::from_utf8(bytes.as_slice()) {
-        Some(s) => s.to_owned(),
+        Some(s) => s.to_string(),
         None => return Err("input not utf-8".to_strbuf()),
     };
 
index f10f16cc07016f4bd10ebb7f3bd5d1441ca751ca..0398738ee0aec27bf6781634a9a44ec7ca6ec101 100644 (file)
@@ -1026,8 +1026,8 @@ fn run_test_inner(desc: TestDesc,
             let stdout = ChanWriter::new(tx.clone());
             let stderr = ChanWriter::new(tx);
             let mut task = TaskBuilder::new().named(match desc.name {
-                DynTestName(ref name) => name.clone().to_owned(),
-                StaticTestName(name) => name.to_owned(),
+                DynTestName(ref name) => name.clone().to_string(),
+                StaticTestName(name) => name.to_string(),
             });
             if nocapture {
                 drop((stdout, stderr));
index 381527763c9628c4910b64c6bad347c620c868bd..1c51ea055d04e3ab30a09831eee315dd7511fcac 100644 (file)
@@ -14,9 +14,9 @@
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "10000000".to_owned())
+        vec!("".to_string(), "10000000".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "100000".to_owned())
+        vec!("".to_string(), "100000".to_string())
     } else {
         args.move_iter().collect()
     };
index 633ac6ebcdff89761700ecd943c5471554c79639..108093acfb4983a25c0a1fc02ffcf0612a3ee75d 100644 (file)
@@ -63,9 +63,9 @@ fn thread_ring(i: uint, count: uint, num_chan: pipe, num_port: pipe) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "100".to_owned(), "10000".to_owned())
+        vec!("".to_string(), "100".to_string(), "10000".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "10".to_owned(), "100".to_owned())
+        vec!("".to_string(), "10".to_string(), "100".to_string())
     } else {
         args.clone().move_iter().collect()
     };
index a324f10fb33af98c6bd59aa48565a8698b7a5567..38a894c4b3d8bf9674b2186e2c00aa467cb27dc7 100644 (file)
@@ -64,9 +64,9 @@ fn thread_ring(i: uint, count: uint, num_chan: pipe, num_port: pipe) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "100".to_owned(), "10000".to_owned())
+        vec!("".to_string(), "100".to_string(), "10000".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "10".to_owned(), "100".to_owned())
+        vec!("".to_string(), "10".to_string(), "100".to_string())
     } else {
         args.clone().move_iter().collect()
     };
index e0116931538e9deb8f947f12d0514cad30ad00be..d8eceec6321df17a1f69c6e6d2ff14e014ca8bb1 100644 (file)
@@ -25,9 +25,9 @@ fn ack(m: int, n: int) -> int {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "12".to_owned())
+        vec!("".to_string(), "12".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "8".to_owned())
+        vec!("".to_string(), "8".to_string())
     } else {
         args.move_iter().collect()
     };
index 76f96f8d43b993d743df9a86a6937923439d8a32..83db926ad6cfa53fc8d8c6d795efbadb05d5a33b 100644 (file)
@@ -21,9 +21,9 @@ fn fib(n: int) -> int {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "40".to_owned())
+        vec!("".to_string(), "40".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "30".to_owned())
+        vec!("".to_string(), "30".to_string())
     } else {
         args.move_iter().collect()
     };
index 3b26de9cf47be2a0a4465ddf54910aa38b6e90b8..f774be582a158fa259ec7d506348aa813c6f1f97 100644 (file)
@@ -32,9 +32,9 @@ fn check_sequential(min: uint, max: uint, map: &SmallIntMap<uint>) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "100000".to_owned(), "100".to_owned())
+        vec!("".to_string(), "100000".to_string(), "100".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "10000".to_owned(), "50".to_owned())
+        vec!("".to_string(), "10000".to_string(), "50".to_string())
     } else {
         args.move_iter().collect()
     };
index 0485e10a38bfa7e9c520c86832e745d4c3c69eed..9235882d1f4980b7d06656f4a5b659e6c8eaebc5 100644 (file)
@@ -67,7 +67,7 @@ pub fn equal(&self, other: &Sudoku) -> bool {
 
     pub fn read(mut reader: BufferedReader<StdReader>) -> Sudoku {
         /* assert first line is exactly "9,9" */
-        assert!(reader.read_line().unwrap() == "9,9".to_owned());
+        assert!(reader.read_line().unwrap() == "9,9".to_string());
 
         let mut g = Vec::from_fn(10u, { |_i| vec!(0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8) });
         for line in reader.lines() {
index 1669f41374d1f952463df08979f973abdcfff048..c631e3e04f2efe894d44b48b16a082496e614de2 100644 (file)
@@ -41,9 +41,9 @@ fn child_generation(gens_left: uint, tx: comm::Sender<()>) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "100000".to_owned())
+        vec!("".to_string(), "100000".to_string())
     } else if args.len() <= 1 {
-        vec!("".to_owned(), "100".to_owned())
+        vec!("".to_string(), "100".to_string())
     } else {
         args.clone().move_iter().collect()
     };
index 0b712923d881b5a6e057ff568fea0f39a003cc82..c980d531bb5ebdab4334b9f3c79f63206ac84ecc 100644 (file)
@@ -49,9 +49,9 @@ fn calc(children: uint, parent_wait_chan: &Sender<Sender<Sender<int>>>) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "30".to_owned())
+        vec!("".to_string(), "30".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "10".to_owned())
+        vec!("".to_string(), "10".to_string())
     } else {
         args
     };
index cb5eb77df6c23838e1328f33fdf8d5c22c45e7d3..8b090d6d7fb79f245709f3453291a7bca803d967 100644 (file)
@@ -25,9 +25,9 @@ fn g() { }
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "400".to_owned())
+        vec!("".to_string(), "400".to_string())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "10".to_owned())
+        vec!("".to_string(), "10".to_string())
     } else {
         args.move_iter().collect()
     };
index ce51c5acd19b35c5160739c5ef3c19b782b8eb3c..c7b573562e3484747c7d272b28e7cd9f7d9ddc19 100644 (file)
@@ -19,7 +19,7 @@ fn arg_closure() {
 }
 
 fn let_pat() {
-    let &_x = &"hi".to_owned();
+    let &_x = &"hi".to_string();
     //~^ ERROR cannot move out of dereference of `&`-pointer
 }
 
index cb1ac467c766849c14e50df123e3ca09b3c1ad23..8a93790d5a2989f9f8930a068684da86b331b57f 100644 (file)
@@ -11,6 +11,6 @@
 use std::rc::Rc;
 
 pub fn main() {
-    let _x = *Rc::new("hi".to_owned());
+    let _x = *Rc::new("hi".to_string());
     //~^ ERROR cannot move out of dereference of `&`-pointer
 }
index 1b83e61cc35dd45c6ad95612ac321319881377e0..ba1d3a9ddba795c749f2e6b5a4660cbfcf71cbc8 100644 (file)
@@ -10,7 +10,7 @@
 
 fn main() {
     let msg;
-    match Some("Hello".to_owned()) {
+    match Some("Hello".to_string()) {
         Some(ref m) => { //~ ERROR borrowed value does not live long enough
             msg = m;
         },
index ad1596d002e392c896d25ffc44f1c9f767845853..ac5ec1236ff9d083294b9503ac261c84022f0436 100644 (file)
@@ -12,7 +12,7 @@
 mod circular_modules_hello; //~ERROR: circular modules
 
 pub fn hi_str() -> String {
-  "Hi!".to_owned()
+  "Hi!".to_string()
 }
 
 fn main() {
index 2722943407b3b814ec66f8b9016615eb31b244dd..9186dada780c039efa6895bb33587755cbb2567e 100644 (file)
@@ -13,5 +13,5 @@
 fn check_bound<T:Copy>(_: T) {}
 
 fn main() {
-    check_bound("nocopy".to_owned()); //~ ERROR does not fulfill `Copy`
+    check_bound("nocopy".to_string()); //~ ERROR does not fulfill `Copy`
 }
index 47ad473c577c21162d4fe18df46372c47dfdaf5b..8a99633b4fc112641ddbb7a310cedb21823d2a0f 100644 (file)
@@ -26,7 +26,7 @@ fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR no longer a special lifeti
 
 fn main() {
     println!("hello");
-    let x = "foo".to_owned();
+    let x = "foo".to_string();
     let y = x;
     println!("{}", y);
 }
index b0adc89cf3088213a4e459b43b9822fc78816cf8..e920976069accd0d536127e3e33b06962f8db187 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo(b: bool) -> Result<bool,String> {
-    Err("bar".to_owned());
+    Err("bar".to_string());
     //~^ ERROR: cannot determine a type for this expression: unconstrained type
 }
 
index b68d3f6d8e40d1c184c63e055cca84ec32bb13c4..97287c147d73f2d8f7da88bde0c2a923c23bb46b 100644 (file)
@@ -11,7 +11,7 @@
 use std::task;
 
 fn main() {
-    let x = "Hello world!".to_owned();
+    let x = "Hello world!".to_string();
     task::spawn(proc() {
         println!("{}", x);
     });
index 07fa6b27cc4979f206e90004b2a93aa4c7b83f0a..f30360af46eb4128fb0b0652c05b21638b417317 100644 (file)
@@ -15,37 +15,37 @@ struct Foo<A> { f: A }
 fn touch<A>(_a: &A) {}
 
 fn f00() {
-    let x = "hi".to_owned();
+    let x = "hi".to_string();
     let _y = Foo { f:x }; //~ NOTE `x` moved here
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
 fn f05() {
-    let x = "hi".to_owned();
+    let x = "hi".to_string();
     let _y = Foo { f:(((x))) }; //~ NOTE `x` moved here
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
 fn f10() {
-    let x = "hi".to_owned();
+    let x = "hi".to_string();
     let _y = Foo { f:x.clone() };
     touch(&x);
 }
 
 fn f20() {
-    let x = "hi".to_owned();
+    let x = "hi".to_string();
     let _y = Foo { f:(x).clone() };
     touch(&x);
 }
 
 fn f30() {
-    let x = "hi".to_owned();
+    let x = "hi".to_string();
     let _y = Foo { f:((x)).clone() };
     touch(&x);
 }
 
 fn f40() {
-    let x = "hi".to_owned();
+    let x = "hi".to_string();
     let _y = Foo { f:(((((((x)).clone()))))) };
     touch(&x);
 }
index b0bdda6c850d969fb32b3656f8b3a971967926bc..65ae25396c8d625502a099a354afc2676ab1e144 100644 (file)
@@ -17,7 +17,7 @@ fn guard(_s: String) -> bool {fail!()}
 fn touch<A>(_a: &A) {}
 
 fn f10() {
-    let x = Foo {f: "hi".to_owned()};
+    let x = Foo {f: "hi".to_string()};
 
     let y = match x {
         Foo {f} => {} //~ NOTE moved here
index 6556d0a51f84e356f30ad0c5848dcaad72fdd296..3521347705b95b668d5441bee750ced19a8acaa9 100644 (file)
@@ -20,7 +20,7 @@ struct R<'a> {
 }
 
 fn innocent_looking_victim() {
-    let mut x = Some("hello".to_owned());
+    let mut x = Some("hello".to_string());
     conspirator(|f, writer| {
         if writer {
             x = None;
index f16e70777ed14b44e5f83737fb800824a64403fa..f772b96c697b7b9cc996e9f23584debc18892d31 100644 (file)
@@ -14,5 +14,5 @@ struct S {
 
 impl Cmp, ToStr for S { //~ ERROR: expected `{` but found `,`
   fn eq(&&other: S) { false }
-  fn to_str(&self) -> String { "hi".to_owned() }
+  fn to_str(&self) -> String { "hi".to_string() }
 }
index 38a09143e3cd0b5923f702c61a5a2ae595956412..d1e50638138c40fc5df877766079165dc75bcc6a 100644 (file)
@@ -13,8 +13,8 @@
 #![feature(concat_idents)]
 
 pub fn main() {
-    let asdf_fdsa = "<.<".to_owned();
-    assert_eq!(concat_idents!(asd, f_f, dsa), "<.<".to_owned());
+    let asdf_fdsa = "<.<".to_string();
+    assert_eq!(concat_idents!(asd, f_f, dsa), "<.<".to_string());
     //~^ ERROR: unresolved name `asdf_fdsa`
 
     assert!(stringify!(use_mention_distinction) ==
index cf7a5c4ad14feb4a67f935c86c130b3802a3f4c9..5f4d51918edc0e901b0b33a39016fce3ef28ea28 100644 (file)
@@ -24,7 +24,7 @@ fn f(&self, x: &'static str) {
 }
 
 fn main() {
-    let person = "Fred".to_owned();
+    let person = "Fred".to_string();
     let person: &str = person.as_slice();  //~ ERROR `person` does not live long enough
     let s: Box<Trait<&'static str>> = box Struct { person: person };
 }
index 28eb4a12739fbaf45301152c01d434f59e27ec9f..e2167ca446f2cc1db1bafbcae2160ec7e4167dea 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    let x = "Hello!".to_owned();
+    let x = "Hello!".to_string();
     let _y = x;
     println!("{}", x); //~ ERROR use of moved value
 }
index c05c3d7fe8fc9b6b44a6278db39afcc8a834dca8..5cf6d838f253fc987ae2b2cc8a8fea6afb25e326 100644 (file)
@@ -15,10 +15,10 @@ fn main() {
     let _y =
         match x {
             Some(_) =>
-            ["some(_)".to_owned(), "not".to_owned(), "SO".to_owned(),
-             "long".to_owned(), "string".to_owned()],
+            ["some(_)".to_string(), "not".to_string(), "SO".to_string(),
+             "long".to_string(), "string".to_string()],
             None =>
-            ["none".to_owned(), "a".to_owned(), "a".to_owned(),
-             "a".to_owned(), "a".to_owned()]
+            ["none".to_string(), "a".to_string(), "a".to_string(),
+             "a".to_string(), "a".to_string()]
         };
 }
index dd44f7de3539fecf8fda0b31fce37bc2009a9b32..bb14a74fc183e8ce0daf2f1a80f70da8da15c908 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
     let x = Some(3);
     let _y =
         match x {
-            Some(_) => "some(_)".to_owned(),
-            None => "none".to_owned()
+            Some(_) => "some(_)".to_string(),
+            None => "none".to_string()
         };
 }
index f30af563aa6d33a66083a4927be718c94fb576e4..ea643fd26d93d360e9172adf46cc968447cd7c26 100644 (file)
@@ -13,7 +13,7 @@
 use std::task::TaskBuilder;
 
 fn main() {
-    TaskBuilder::new().named("owned name".to_owned()).try(proc() {
+    TaskBuilder::new().named("owned name".to_string()).try(proc() {
         fail!("test");
         1
     }).unwrap()
index 2e76c8150d871b8abcc3007342e9a2f58b2c7126..08c8461afe02929d79a55131485fce9ed5ffd054 100644 (file)
@@ -17,7 +17,7 @@ fn failfn() {
 }
 
 fn main() {
-    let x = @"hi".to_owned();
+    let x = @"hi".to_string();
     failfn();
     println!("{:?}", x);
 }
index be22b368c0c78da3b135c123629038aaaf7a5c05..4af77c434829a14d72d80335ad63d8489cac2cb2 100644 (file)
@@ -16,9 +16,9 @@ fn test_box() {
     @0;
 }
 fn test_str() {
-  let res = match false { true => { "happy".to_owned() },
+  let res = match false { true => { "happy".to_string() },
      _ => fail!("non-exhaustive match failure") };
-  assert_eq!(res, "happy".to_owned());
+  assert_eq!(res, "happy".to_string());
 }
 fn main() {
     test_box();
index 85fbda610cb9e6c7576f055a3777e13d5c104349..36b525c134b9940e7e01d6c26ca984edaa42f4a5 100644 (file)
@@ -57,20 +57,20 @@ fn main() {
     let cx = mk_ctxt();
 
     let abc = quote_expr!(cx, 23);
-    check_pp(ext_cx, abc,  pprust::print_expr, "23".to_owned());
+    check_pp(ext_cx, abc,  pprust::print_expr, "23".to_string());
 
 
     let ty = quote_ty!(cx, int);
-    check_pp(ext_cx, ty, pprust::print_type, "int".to_owned());
+    check_pp(ext_cx, ty, pprust::print_type, "int".to_string());
 
     let item = quote_item!(cx, static x : int = 10;).get();
-    check_pp(ext_cx, item, pprust::print_item, "static x: int = 10;".to_owned());
+    check_pp(ext_cx, item, pprust::print_item, "static x: int = 10;".to_string());
 
     let stmt = quote_stmt!(cx, let x = 20;);
-    check_pp(ext_cx, *stmt, pprust::print_stmt, "let x = 20;".to_owned());
+    check_pp(ext_cx, *stmt, pprust::print_stmt, "let x = 20;".to_string());
 
     let pat = quote_pat!(cx, Some(_));
-    check_pp(ext_cx, pat, pprust::print_pat, "Some(_)".to_owned());
+    check_pp(ext_cx, pat, pprust::print_pat, "Some(_)".to_string());
 
 }
 
@@ -82,7 +82,7 @@ fn check_pp<T>(cx: fake_ext_ctxt,
         pp::eof(pp.s);
     });
     stdout().write_line(s);
-    if expect != "".to_owned() {
+    if expect != "".to_string() {
         println!("expect: '%s', got: '%s'", expect, s);
         assert_eq!(s, expect);
     }
index c32d513f074558aaf5e876016956da7214808805..4adf10636e6a7897d94afb5551418a4d1e47f1da 100644 (file)
@@ -15,7 +15,7 @@ struct Point { x : int }
 
 pub fn main() {
     assert_eq!(14,14);
-    assert_eq!("abc".to_owned(),"abc".to_owned());
+    assert_eq!("abc".to_string(),"abc".to_string());
     assert_eq!(box Point{x:34},box Point{x:34});
     assert_eq!(&Point{x:34},&Point{x:34});
     assert_eq!(@Point{x:34},@Point{x:34});
index 10a3db5808e2d0ee1c2b2a83edd272eacf344599..ba41b1ffe9d037386847c7bbb105d1763a6ff500 100644 (file)
@@ -12,6 +12,6 @@
 
 pub fn main() {
     assert!((@1 < @3));
-    assert!((@@"hello ".to_owned() > @@"hello".to_owned()));
-    assert!((@@@"hello".to_owned() != @@@"there".to_owned()));
+    assert!((@@"hello ".to_string() > @@"hello".to_string()));
+    assert!((@@@"hello".to_string() != @@@"there".to_string()));
 }
index 7042f875111ad3a0c39a8b2431e40bff16020602..beffc171cd5cdb1723791d6fc71f1db1c1da0a28 100644 (file)
 
 pub fn main() {
     let lst = new_int_alist();
-    alist_add(&lst, 22, "hi".to_owned());
-    alist_add(&lst, 44, "ho".to_owned());
-    assert_eq!(alist_get(&lst, 22), "hi".to_owned());
-    assert_eq!(alist_get(&lst, 44), "ho".to_owned());
+    alist_add(&lst, 22, "hi".to_string());
+    alist_add(&lst, 44, "ho".to_string());
+    assert_eq!(alist_get(&lst, 22), "hi".to_string());
+    assert_eq!(alist_get(&lst, 44), "ho".to_string());
 
     let lst = new_int_alist_2();
-    alist_add(&lst, 22, "hi".to_owned());
-    alist_add(&lst, 44, "ho".to_owned());
-    assert_eq!(alist_get(&lst, 22), "hi".to_owned());
-    assert_eq!(alist_get(&lst, 44), "ho".to_owned());
+    alist_add(&lst, 22, "hi".to_string());
+    alist_add(&lst, 44, "ho".to_string());
+    assert_eq!(alist_get(&lst, 22), "hi".to_string());
+    assert_eq!(alist_get(&lst, 44), "ho".to_string());
 }
index b6fdaf91dc8062400deedb40dbc4352489ff895d..94c78522df40e39600a109fb546888c92617bf36 100644 (file)
 
 pub fn main() {
   let mut nyan : cat<char> = cat::<char>(52u, 99, vec!('p'));
-  let mut kitty = cat(1000u, 2, vec!("tabby".to_owned()));
+  let mut kitty = cat(1000u, 2, vec!("tabby".to_string()));
   assert_eq!(nyan.how_hungry, 99);
   assert_eq!(kitty.how_hungry, 2);
   nyan.speak(vec!(1u,2u,3u));
   assert_eq!(nyan.meow_count(), 55u);
-  kitty.speak(vec!("meow".to_owned(), "mew".to_owned(), "purr".to_owned(), "chirp".to_owned()));
+  kitty.speak(vec!("meow".to_string(), "mew".to_string(), "purr".to_string(), "chirp".to_string()));
   assert_eq!(kitty.meow_count(), 1004u);
 }
index 515613675cb264707ae088cb8ef00f664888a39a..4f94673a2c027ef7b647f15527afc8b7cb26babb 100644 (file)
@@ -33,11 +33,11 @@ fn cat<U>(in_x : uint, in_y : int, in_info: Vec<U> ) -> cat<U> {
 
 pub fn main() {
   let mut nyan : cat<int> = cat::<int>(52u, 99, vec!(9));
-  let mut kitty = cat(1000u, 2, vec!("tabby".to_owned()));
+  let mut kitty = cat(1000u, 2, vec!("tabby".to_string()));
   assert_eq!(nyan.how_hungry, 99);
   assert_eq!(kitty.how_hungry, 2);
   nyan.speak(vec!(1,2,3));
   assert_eq!(nyan.meow_count(), 55u);
-  kitty.speak(vec!("meow".to_owned(), "mew".to_owned(), "purr".to_owned(), "chirp".to_owned()));
+  kitty.speak(vec!("meow".to_string(), "mew".to_string(), "purr".to_string(), "chirp".to_string()));
   assert_eq!(kitty.meow_count(), 1004u);
 }
index 0c372deae2c12c1e364d5f7d4adf59e3e979f03e..5597d5fa01135c42d1c89667ffb6ff598cc18851 100644 (file)
@@ -26,9 +26,9 @@ pub fn main() {
     let args = os::args();
     let args = args.as_slice();
 
-    // Here, the rvalue `"signal".to_owned()` requires cleanup. Older versions
+    // Here, the rvalue `"signal".to_string()` requires cleanup. Older versions
     // of the code had a problem that the cleanup scope for this
-    // expression was the end of the `if`, and as the `"signal".to_owned()`
+    // expression was the end of the `if`, and as the `"signal".to_string()`
     // expression was never evaluated, we wound up trying to clean
     // uninitialized memory.
 
index c864db33b21adfcd04bb1550341fff2eb826de2d..7ca4e25a74d339e1d4ed5935066469f86ff016d0 100644 (file)
@@ -18,7 +18,7 @@ struct F { field: int }
 
 pub fn main() {
     /*foo(1);
-    foo("hi".to_owned());
+    foo("hi".to_string());
     foo(~[1, 2, 3]);
     foo(F{field: 42});
     foo((1, 2u));
index 8569bc40d2e1c36a69e3e56b9ce20a07d6f54ac3..77c7a08f4ca1761db87023b3ffa9ab2ec1cfed03 100644 (file)
@@ -18,12 +18,12 @@ pub fn main() {
     unsafe {
         let foo = &A as *u8;
         assert_eq!(str::raw::from_utf8(A), "hi");
-        assert_eq!(str::raw::from_buf_len(foo, A.len()), "hi".to_owned());
-        assert_eq!(str::raw::from_buf_len(C, B.len()), "hi".to_owned());
+        assert_eq!(str::raw::from_buf_len(foo, A.len()), "hi".to_string());
+        assert_eq!(str::raw::from_buf_len(C, B.len()), "hi".to_string());
         assert!(*C == A[0]);
         assert!(*(&B[0] as *u8) == A[0]);
 
         let bar = str::raw::from_utf8(A).to_c_str();
-        assert_eq!(bar.with_ref(|buf| str::raw::from_c_str(buf)), "hi".to_owned());
+        assert_eq!(bar.with_ref(|buf| str::raw::from_c_str(buf)), "hi".to_string());
     }
 }
index 78e2d3caea9b990471fa9fa1cb5261577b951206..3918f7eb73d805f16364879c6917a9ba910fd90d 100644 (file)
@@ -17,8 +17,8 @@ fn test_box() {
 }
 
 fn test_str() {
-    let rs = if true { "happy".to_owned() } else { "sad".to_owned() };
-    assert_eq!(rs, "happy".to_owned());
+    let rs = if true { "happy".to_string() } else { "sad".to_string() };
+    assert_eq!(rs, "happy".to_string());
 }
 
 pub fn main() { test_box(); test_str(); }
index de08c537abb853bc3f450575b7839b6e3816de98..457d3e8d98642d6e83a8b9faeeb8fdcbc40849ae 100644 (file)
@@ -17,9 +17,9 @@ fn test_box() {
 }
 
 fn test_str() {
-    let res = match true { true => { "happy".to_owned() },
+    let res = match true { true => { "happy".to_string() },
                          _ => fail!("not happy at all") };
-    assert_eq!(res, "happy".to_owned());
+    assert_eq!(res, "happy".to_string());
 }
 
 pub fn main() { test_box(); test_str(); }
index 26fefabdf9dd20e7890e9d121c97592d4d36b199..52d7c4cb170ebe1b5cc6ce311de6bd6d3fd8a319 100644 (file)
@@ -14,4 +14,4 @@
 // This used to cause memory corruption in stage 0.
 enum thing<K> { some(K), }
 
-pub fn main() { let _x = some("hi".to_owned()); }
+pub fn main() { let _x = some("hi".to_string()); }
index ca2420bc573208ab0cbde52e580f6e3cb1ee4afc..3b09cf0373eb1bf93482f07e3fd47ae0faa88d02 100644 (file)
@@ -52,7 +52,7 @@ pub fn main() {
     t!(format!("{}", 1.0f32), "1");
     t!(format!("{}", 1.0f64), "1");
     t!(format!("{}", "a"), "a");
-    t!(format!("{}", "a".to_owned()), "a");
+    t!(format!("{}", "a".to_string()), "a");
     t!(format!("{}", false), "false");
     t!(format!("{}", 'a'), "a");
 
@@ -66,7 +66,7 @@ pub fn main() {
     t!(format!("{:x}", 10u), "a");
     t!(format!("{:X}", 10u), "A");
     t!(format!("{:s}", "foo"), "foo");
-    t!(format!("{:s}", "foo".to_owned()), "foo");
+    t!(format!("{:s}", "foo".to_string()), "foo");
     t!(format!("{:p}", 0x1234 as *int), "0x1234");
     t!(format!("{:p}", 0x1234 as *mut int), "0x1234");
     t!(format!("{:d}", A), "aloha");
index 97f9c6bef7fa2cdb8fa1fa3fd9990c9b11a64b08..b2b16c4ef84201229444bce76a2f29037727d7c4 100644 (file)
 pub fn main() {
     let x = 2;
     let x_message = match x {
-      0 .. 1     => { "not many".to_owned() }
-      _          => { "lots".to_owned() }
+      0 .. 1     => { "not many".to_string() }
+      _          => { "lots".to_string() }
     };
-    assert_eq!(x_message, "lots".to_owned());
+    assert_eq!(x_message, "lots".to_string());
 
     let y = 2i;
     let y_message = match y {
-      0 .. 1     => { "not many".to_owned() }
-      _          => { "lots".to_owned() }
+      0 .. 1     => { "not many".to_string() }
+      _          => { "lots".to_string() }
     };
-    assert_eq!(y_message, "lots".to_owned());
+    assert_eq!(y_message, "lots".to_string());
 
     let z = 1u64;
     let z_message = match z {
-      0 .. 1     => { "not many".to_owned() }
-      _          => { "lots".to_owned() }
+      0 .. 1     => { "not many".to_string() }
+      _          => { "lots".to_string() }
     };
-    assert_eq!(z_message, "not many".to_owned());
+    assert_eq!(z_message, "not many".to_string());
 }
index 3cb71cb75e0fd3c8e51f519b80249aa03b2fccf4..7d5bd9d6a74db57c3614deece86a932dab8f0bbf 100644 (file)
@@ -9,10 +9,10 @@
 // except according to those terms.
 
 pub fn main () {
-  let mut line = "".to_owned();
+  let mut line = "".to_string();
   let mut i = 0;
-  while line != "exit".to_owned() {
-    line = if i == 9 { "exit".to_owned() } else { "notexit".to_owned() };
+  while line != "exit".to_string() {
+    line = if i == 9 { "exit".to_string() } else { "notexit".to_string() };
     i += 1;
   }
 }
index 81d3466751987507a3547b02c220d2b43cbbb53f..9d71aea01d01da7931a94c0a53a0e161fda80adc 100644 (file)
@@ -11,8 +11,8 @@
 // Issue 1974
 // Don't double free the condition allocation
 pub fn main() {
-    let s = "hej".to_owned();
-    while s != "".to_owned() {
+    let s = "hej".to_string();
+    while s != "".to_string() {
         return;
     }
 }
index 9f337ecfe37ce1958e7a0af0a22b40bac737aac9..3422b9a799dfe6c82c5192ddff1e38b4af88a2fb 100644 (file)
@@ -17,7 +17,7 @@ fn perform_hax<T: 'static>(x: Box<T>) -> Box<hax:> {
 }
 
 fn deadcode() {
-    perform_hax(box "deadcode".to_owned());
+    perform_hax(box "deadcode".to_string());
 }
 
 pub fn main() {
index bdaf8ac9755049a51787bdc1b26e40ce7039a010..8a5391773bb592d879a202d4e1c9c9d18f8fcd5d 100644 (file)
@@ -17,7 +17,7 @@ fn perform_hax<T: 'static>(x: Box<T>) -> Box<hax:> {
 }
 
 fn deadcode() {
-    perform_hax(box "deadcode".to_owned());
+    perform_hax(box "deadcode".to_string());
 }
 
 pub fn main() {
index 2ce3cb931e5d9772b12ab7f6ed13dedc36465bee..5542418ebddb2621fe961ebf6d628f657a4be591 100644 (file)
@@ -30,14 +30,14 @@ enum square {
 impl fmt::Show for square {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "{}", match *self {
-          bot => { "R".to_owned() }
-          wall => { "#".to_owned() }
-          rock => { "*".to_owned() }
-          lambda => { "\\".to_owned() }
-          closed_lift => { "L".to_owned() }
-          open_lift => { "O".to_owned() }
-          earth => { ".".to_owned() }
-          empty => { " ".to_owned() }
+          bot => { "R".to_string() }
+          wall => { "#".to_string() }
+          rock => { "*".to_string() }
+          lambda => { "\\".to_string() }
+          closed_lift => { "L".to_string() }
+          open_lift => { "O".to_string() }
+          earth => { ".".to_string() }
+          empty => { " ".to_string() }
         })
     }
 }
index 1e846663499ee8fa20cdcad64e8a0414a36ea88d..ac93742342377a0cd7f23db8d4b28fce9d95a50e 100644 (file)
@@ -31,8 +31,8 @@ fn check_strs(actual: &str, expected: &str) -> bool
 
 pub fn main()
 {
-// assert!(check_strs(fmt!("%?", Text(@"foo".to_owned())), "Text(@~\"foo\")"));
-// assert!(check_strs(fmt!("%?", ETag(@~["foo".to_owned()], @"bar".to_owned())),
+// assert!(check_strs(fmt!("%?", Text(@"foo".to_string())), "Text(@~\"foo\")"));
+// assert!(check_strs(fmt!("%?", ETag(@~["foo".to_string()], @"bar".to_string())),
 //                    "ETag(@~[ ~\"foo\" ], @~\"bar\")"));
 
     let t = Text(@"foo".to_strbuf());
index 31fa2708488ec16bd247f86e5a328aa00ff58321..b27720b8579a4b4a51c511d8b366944cbffc0dfd 100644 (file)
@@ -97,12 +97,12 @@ enum Result {
 }
 
 priv fn cmd_to_str(cmd: ~[String]) -> String {
-  let mut res = "*".to_owned();
+  let mut res = "*".to_string();
   res.push_str(cmd.len().to_str());
   res.push_str("\r\n");
     for s in cmd.iter() {
-    res.push_str(["$".to_owned(), s.len().to_str(), "\r\n".to_owned(),
-                  (*s).clone(), "\r\n".to_owned()].concat() );
+    res.push_str(["$".to_string(), s.len().to_str(), "\r\n".to_string(),
+                  (*s).clone(), "\r\n".to_string()].concat() );
     }
   res
 }
@@ -117,7 +117,7 @@ fn query(cmd: ~[String], sb: TcpSocketBuf) -> Result {
 
 fn query2(cmd: ~[String]) -> Result {
   let _cmd = cmd_to_str(cmd);
-    io::with_str_reader("$3\r\nXXX\r\n".to_owned())(|sb| {
+    io::with_str_reader("$3\r\nXXX\r\n".to_string())(|sb| {
     let res = parse_response(@sb as @io::Reader);
     println!("{:?}", res);
     res
index 2f8f16fb1aea9ecedea6cbbfc01044aff5a45f26..b260e0af9e3ad728d46f22c35be9a8217ae67749 100644 (file)
@@ -14,7 +14,7 @@ pub fn main() {
     for i in x.iter() { println!("{:?}", *i); y += *i; }
     println!("{:?}", y);
     assert_eq!(y, 6);
-    let s = "hello there".to_owned();
+    let s = "hello there".to_string();
     let mut i: int = 0;
     for c in s.as_slice().bytes() {
         if i == 0 { assert!((c == 'h' as u8)); }
index 06151e498f5367f7e0e3819b0bc2486a69dd9096..7f9a4593780a5a35ebfe93645fd28b233dad3931 100644 (file)
@@ -29,7 +29,7 @@ fn main() {
         return
     }
 
-    let env = [("RUST_LOG".to_owned(), "debug".to_owned())];
+    let env = [("RUST_LOG".to_string(), "debug".to_string())];
     let p = Command::new(args[0].as_slice())
                     .arg("child").env(env.as_slice())
                     .spawn().unwrap().wait_with_output().unwrap();
index 4a5874536cfb473ec3cca1c8e424c3c7d48418ff..d17bf8500e06ea0e095e8b121890721c25d1c6c1 100644 (file)
 
 fn test1() {
     // from issue 6338
-    match ((1, "a".to_owned()), (2, "b".to_owned())) {
+    match ((1, "a".to_string()), (2, "b".to_string())) {
         ((1, a), (2, b)) | ((2, b), (1, a)) => {
-                assert_eq!(a, "a".to_owned());
-                assert_eq!(b, "b".to_owned());
+                assert_eq!(a, "a".to_string());
+                assert_eq!(b, "b".to_string());
             },
             _ => fail!(),
     }
index 5eb806fe859950ad36c1051e3528bdc6a3065217..7fd37969e672116d3bba22b9c58aca682396ab53 100644 (file)
@@ -11,7 +11,7 @@
 use std::task;
 
 pub fn main() {
-    let x = "Hello world!".to_owned();
+    let x = "Hello world!".to_string();
     task::spawn(proc() {
         println!("{}", x);
     });
index b72c4f92ea3e796cf73641c725b712759a800f77..c6f3dae7fc177c18cf117d5b4284d257f0befdc3 100644 (file)
@@ -40,8 +40,8 @@ fn index(&self, index: &K) -> V {
 }
 
 pub fn main() {
-    let foo = "foo".to_owned();
-    let bar = "bar".to_owned();
+    let foo = "foo".to_string();
+    let bar = "bar".to_string();
 
     let mut list = AssociationList {pairs: Vec::new()};
     list.push(foo.clone(), 22);
index 3bacdac78762dd8f813a372665f992eb7df8ab9f..c9d5d02c2478f30c612d36c156052eb457542a4b 100644 (file)
@@ -30,7 +30,7 @@ pub fn main() {
     *i.borrow_mut() = 5;
     assert_eq!((i_value, *i.borrow()), (2, 5));
 
-    let s = Rc::new("foo".to_owned());
+    let s = Rc::new("foo".to_string());
     assert!(s.equiv(&("foo")));
     assert_eq!(s.as_slice(), "foo");
 
index 28930af2962b28316e4ac890b1d8c018fa019951..b28494109deb750330465e7ca317c0af97c3d724 100644 (file)
@@ -28,8 +28,8 @@ pub fn main() {
     *(*i).borrow_mut() = 5;
     assert_eq!((i_value, *(*i).borrow()), (2, 5));
 
-    let s = Rc::new("foo".to_owned());
-    assert_eq!(*s, "foo".to_owned());
+    let s = Rc::new("foo".to_string());
+    assert_eq!(*s, "foo".to_string());
     assert_eq!((*s).as_slice(), "foo");
 
     let mut_s = Rc::new(RefCell::new(String::from_str("foo")));
index f371d08b9609e5cf516b5578705bff108ec7a339..bf7a8fabff33b4025a68ad70d6a8bc31b11e829c 100644 (file)
@@ -35,7 +35,7 @@ fn rename_directory() {
             })
         });
         assert!((ostream as uint != 0u));
-        let s = "hello".to_owned();
+        let s = "hello".to_string();
         "hello".with_c_str(|buf| {
             let write_len = libc::fwrite(buf as *libc::c_void,
                                          1u as libc::size_t,
index 869dd3f7ff15f788ce956b1ee29f73efc737f429..90faf97893a0fb016ab0469168fd515339f987fa 100644 (file)
 pub fn main() {
     let mut map: HashMap<SendStr, uint> = HashMap::new();
     assert!(map.insert(Slice("foo"), 42));
-    assert!(!map.insert(Owned("foo".to_owned()), 42));
+    assert!(!map.insert(Owned("foo".to_string()), 42));
     assert!(!map.insert(Slice("foo"), 42));
-    assert!(!map.insert(Owned("foo".to_owned()), 42));
+    assert!(!map.insert(Owned("foo".to_string()), 42));
 
     assert!(!map.insert(Slice("foo"), 43));
-    assert!(!map.insert(Owned("foo".to_owned()), 44));
+    assert!(!map.insert(Owned("foo".to_string()), 44));
     assert!(!map.insert(Slice("foo"), 45));
-    assert!(!map.insert(Owned("foo".to_owned()), 46));
+    assert!(!map.insert(Owned("foo".to_string()), 46));
 
     let v = 46;
 
-    assert_eq!(map.find(&Owned("foo".to_owned())), Some(&v));
+    assert_eq!(map.find(&Owned("foo".to_string())), Some(&v));
     assert_eq!(map.find(&Slice("foo")), Some(&v));
 
     let (a, b, c, d) = (50, 51, 52, 53);
 
     assert!(map.insert(Slice("abc"), a));
-    assert!(map.insert(Owned("bcd".to_owned()), b));
+    assert!(map.insert(Owned("bcd".to_string()), b));
     assert!(map.insert(Slice("cde"), c));
-    assert!(map.insert(Owned("def".to_owned()), d));
+    assert!(map.insert(Owned("def".to_string()), d));
 
     assert!(!map.insert(Slice("abc"), a));
-    assert!(!map.insert(Owned("bcd".to_owned()), b));
+    assert!(!map.insert(Owned("bcd".to_string()), b));
     assert!(!map.insert(Slice("cde"), c));
-    assert!(!map.insert(Owned("def".to_owned()), d));
+    assert!(!map.insert(Owned("def".to_string()), d));
 
-    assert!(!map.insert(Owned("abc".to_owned()), a));
+    assert!(!map.insert(Owned("abc".to_string()), a));
     assert!(!map.insert(Slice("bcd"), b));
-    assert!(!map.insert(Owned("cde".to_owned()), c));
+    assert!(!map.insert(Owned("cde".to_string()), c));
     assert!(!map.insert(Slice("def"), d));
 
     assert_eq!(map.find_equiv(&("abc")), Some(&a));
index 66d799667329160655877d26d1a726a4afebcd9c..9c727314ffbf50900f5ffaf2b210ee0b925f9624 100644 (file)
 pub fn main() {
     let mut map: TreeMap<SendStr, uint> = TreeMap::new();
     assert!(map.insert(Slice("foo"), 42));
-    assert!(!map.insert(Owned("foo".to_owned()), 42));
+    assert!(!map.insert(Owned("foo".to_string()), 42));
     assert!(!map.insert(Slice("foo"), 42));
-    assert!(!map.insert(Owned("foo".to_owned()), 42));
+    assert!(!map.insert(Owned("foo".to_string()), 42));
 
     assert!(!map.insert(Slice("foo"), 43));
-    assert!(!map.insert(Owned("foo".to_owned()), 44));
+    assert!(!map.insert(Owned("foo".to_string()), 44));
     assert!(!map.insert(Slice("foo"), 45));
-    assert!(!map.insert(Owned("foo".to_owned()), 46));
+    assert!(!map.insert(Owned("foo".to_string()), 46));
 
     let v = 46;
 
-    assert_eq!(map.find(&Owned("foo".to_owned())), Some(&v));
+    assert_eq!(map.find(&Owned("foo".to_string())), Some(&v));
     assert_eq!(map.find(&Slice("foo")), Some(&v));
 
     let (a, b, c, d) = (50, 51, 52, 53);
 
     assert!(map.insert(Slice("abc"), a));
-    assert!(map.insert(Owned("bcd".to_owned()), b));
+    assert!(map.insert(Owned("bcd".to_string()), b));
     assert!(map.insert(Slice("cde"), c));
-    assert!(map.insert(Owned("def".to_owned()), d));
+    assert!(map.insert(Owned("def".to_string()), d));
 
     assert!(!map.insert(Slice("abc"), a));
-    assert!(!map.insert(Owned("bcd".to_owned()), b));
+    assert!(!map.insert(Owned("bcd".to_string()), b));
     assert!(!map.insert(Slice("cde"), c));
-    assert!(!map.insert(Owned("def".to_owned()), d));
+    assert!(!map.insert(Owned("def".to_string()), d));
 
-    assert!(!map.insert(Owned("abc".to_owned()), a));
+    assert!(!map.insert(Owned("abc".to_string()), a));
     assert!(!map.insert(Slice("bcd"), b));
-    assert!(!map.insert(Owned("cde".to_owned()), c));
+    assert!(!map.insert(Owned("cde".to_string()), c));
     assert!(!map.insert(Slice("def"), d));
 
     assert_eq!(map.find(&Slice("abc")), Some(&a));
@@ -55,14 +55,14 @@ pub fn main() {
     assert_eq!(map.find(&Slice("cde")), Some(&c));
     assert_eq!(map.find(&Slice("def")), Some(&d));
 
-    assert_eq!(map.find(&Owned("abc".to_owned())), Some(&a));
-    assert_eq!(map.find(&Owned("bcd".to_owned())), Some(&b));
-    assert_eq!(map.find(&Owned("cde".to_owned())), Some(&c));
-    assert_eq!(map.find(&Owned("def".to_owned())), Some(&d));
+    assert_eq!(map.find(&Owned("abc".to_string())), Some(&a));
+    assert_eq!(map.find(&Owned("bcd".to_string())), Some(&b));
+    assert_eq!(map.find(&Owned("cde".to_string())), Some(&c));
+    assert_eq!(map.find(&Owned("def".to_string())), Some(&d));
 
     assert!(map.pop(&Slice("foo")).is_some());
     assert_eq!(map.move_iter().map(|(k, v)| format_strbuf!("{}{}", k, v))
                               .collect::<Vec<String>>()
                               .concat(),
-               "abc50bcd51cde52def53".to_owned());
+               "abc50bcd51cde52def53".to_string());
 }
index 16e661a1da0eef4bc946f74a5b57be04a5ab8d32..ef14e0ba931b5525d42131e35a5315c1ab610ec5 100644 (file)
@@ -10,9 +10,9 @@
 
 
 pub fn main() {
-    assert!(("hello".to_owned() < "hellr".to_owned()));
-    assert!(("hello ".to_owned() > "hello".to_owned()));
-    assert!(("hello".to_owned() != "there".to_owned()));
+    assert!(("hello".to_string() < "hellr".to_string()));
+    assert!(("hello ".to_string() > "hello".to_string()));
+    assert!(("hello".to_string() != "there".to_string()));
     assert!((vec!(1, 2, 3, 4) > vec!(1, 2, 3)));
     assert!((vec!(1, 2, 3) < vec!(1, 2, 3, 4)));
     assert!((vec!(1, 2, 4, 4) > vec!(1, 2, 3, 4)));
index d65eb6415bfc09b50789233410fb51a4fc0d618c..75d7b3ed2cde5b944110c222d747f64839b65394 100644 (file)
@@ -11,7 +11,7 @@
 
 
 pub fn main() {
-    let s = "hello".to_owned();
+    let s = "hello".to_string();
     let c: u8 = s.as_slice()[4];
     println!("{:?}", c);
     assert_eq!(c, 0x6f as u8);
index 6cc3e79ac67bd30c6d79a9f46e818bf80d584201..e8c18607f95a03b9caf79daf2f140f2f4f6c7f2f 100644 (file)
@@ -25,8 +25,8 @@ pub fn main() {
     assert_eq!(foo, foo_);
 
     let foo = Foo {
-        bar: "one".to_owned(),
-        baz: "two".to_owned()
+        bar: "one".to_string(),
+        baz: "two".to_string()
     };
 
     let foo_ = foo.clone();
index 963121fff82280da696a085f460765f89118b983..18336a603187de5a2bffd509f10a67bf62ab7f52 100644 (file)
@@ -36,7 +36,7 @@ fn test_vec() {
 
 fn test_str() {
     let (tx, rx) = channel();
-    let s0 = "test".to_owned();
+    let s0 = "test".to_string();
     tx.send(s0);
     let s1 = rx.recv();
     assert_eq!(s1.as_slice()[0], 't' as u8);
index 2cd0c541db59b1b8dde677601d68882cb8673c6b..fc4acfd5bb3c29314bf4500ee71e6a1578b1b523 100644 (file)
@@ -36,5 +36,5 @@ fn do_get(&self) -> T { self.get_ref().clone() }
 
 pub fn main() {
     assert_eq!(3.do_get2(), (3, 3));
-    assert_eq!(Some("hi".to_owned()).do_get2(), ("hi".to_owned(), "hi".to_owned()));
+    assert_eq!(Some("hi".to_string()).do_get2(), ("hi".to_string(), "hi".to_string()));
 }
index 8c36a66a1e71cadd6c221e30003c4be1ba2e6db8..4061a475e6cadf86f9c2ae52da615f33227dc277 100644 (file)
@@ -29,7 +29,7 @@ fn make_uniq_closure<A:Send>(a: A) -> proc():Send -> uint {
 fn empty_pointy() -> @RefCell<Pointy> {
     return @RefCell::new(Pointy {
         a : none,
-        d : make_uniq_closure("hi".to_owned())
+        d : make_uniq_closure("hi".to_string())
     })
 }