]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/passes.rs
Replace all ~"" with "".to_owned()
[rust.git] / src / librustdoc / passes.rs
index 3f45b1a7e699edde842547358671d99e1c04420c..ed71dc27d9d30e8c07453917019927e60fe8217c 100644 (file)
@@ -219,7 +219,7 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
             for attr in i.attrs.iter() {
                 match attr {
                     &clean::NameValue(ref x, ref s) if "doc" == *x => avec.push(
-                        clean::NameValue(~"doc", unindent(*s))),
+                        clean::NameValue("doc".to_owned(), unindent(*s))),
                     x => avec.push(x.clone())
                 }
             }
@@ -252,7 +252,7 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
                 _ => true
             }).map(|x| x.clone()).collect();
             if docstr.len() > 0 {
-                a.push(clean::NameValue(~"doc", docstr.into_owned()));
+                a.push(clean::NameValue("doc".to_owned(), docstr.into_owned()));
             }
             i.attrs = a;
             self.fold_item_recur(i)
@@ -329,25 +329,25 @@ mod unindent_tests {
 
     #[test]
     fn should_unindent() {
-        let s = ~"    line1\n    line2";
+        let s = "    line1\n    line2".to_owned();
         let r = unindent(s);
-        assert_eq!(r, ~"line1\nline2");
+        assert_eq!(r, "line1\nline2".to_owned());
     }
 
     #[test]
     fn should_unindent_multiple_paragraphs() {
-        let s = ~"    line1\n\n    line2";
+        let s = "    line1\n\n    line2".to_owned();
         let r = unindent(s);
-        assert_eq!(r, ~"line1\n\nline2");
+        assert_eq!(r, "line1\n\nline2".to_owned());
     }
 
     #[test]
     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";
+        let s = "    line1\n\n        line2".to_owned();
         let r = unindent(s);
-        assert_eq!(r, ~"line1\n\n    line2");
+        assert_eq!(r, "line1\n\n    line2".to_owned());
     }
 
     #[test]
@@ -357,15 +357,15 @@ fn should_ignore_first_line_indent() {
         //
         // #[doc = "Start way over here
         //          and continue here"]
-        let s = ~"line1\n    line2";
+        let s = "line1\n    line2".to_owned();
         let r = unindent(s);
-        assert_eq!(r, ~"line1\nline2");
+        assert_eq!(r, "line1\nline2".to_owned());
     }
 
     #[test]
     fn should_not_ignore_first_line_indent_in_a_single_line_para() {
-        let s = ~"line1\n\n    line2";
+        let s = "line1\n\n    line2".to_owned();
         let r = unindent(s);
-        assert_eq!(r, ~"line1\n\n    line2");
+        assert_eq!(r, "line1\n\n    line2".to_owned());
     }
 }