about summary refs log tree commit diff
path: root/src/libsyntax/parse/comments.rs
diff options
context:
space:
mode:
authorRicho Healey <richo@psych0tik.net>2014-04-15 18:17:48 -0700
committerBrian Anderson <banderson@mozilla.com>2014-04-18 17:25:34 -0700
commit919889a1d688a6bbe2edac8705f048f06b1b455c (patch)
tree322a69fa39bdaf37bbfffc84020acbd4c87871d0 /src/libsyntax/parse/comments.rs
parentb75683cadf6c4c55360202cd6a0106be80532451 (diff)
downloadrust-919889a1d688a6bbe2edac8705f048f06b1b455c.tar.gz
rust-919889a1d688a6bbe2edac8705f048f06b1b455c.zip
Replace all ~"" with "".to_owned()
Diffstat (limited to 'src/libsyntax/parse/comments.rs')
-rw-r--r--src/libsyntax/parse/comments.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index 1a246eb7f2c..a96905f8597 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -238,7 +238,7 @@ fn trim_whitespace_prefix_and_push_line(lines: &mut Vec<~str> ,
         Some(col) => {
             if col < len {
                 s.slice(col, len).to_owned()
-            } else {  ~"" }
+            } else {  "".to_owned() }
         }
         None => s,
     };
@@ -279,7 +279,7 @@ fn read_block_comment(rdr: &mut StringReader,
         while level > 0 {
             debug!("=== block comment level {}", level);
             if is_eof(rdr) {
-                rdr.fatal(~"unterminated block comment");
+                rdr.fatal("unterminated block comment".to_owned());
             }
             if rdr.curr_is('\n') {
                 trim_whitespace_prefix_and_push_line(&mut lines,
@@ -405,41 +405,41 @@ mod test {
     #[test] fn test_block_doc_comment_1() {
         let comment = "/**\n * Test \n **  Test\n *   Test\n*/";
         let stripped = strip_doc_comment_decoration(comment);
-        assert_eq!(stripped, ~" Test \n*  Test\n   Test");
+        assert_eq!(stripped, " Test \n*  Test\n   Test".to_owned());
     }
 
     #[test] fn test_block_doc_comment_2() {
         let comment = "/**\n * Test\n *  Test\n*/";
         let stripped = strip_doc_comment_decoration(comment);
-        assert_eq!(stripped, ~" Test\n  Test");
+        assert_eq!(stripped, " Test\n  Test".to_owned());
     }
 
     #[test] fn test_block_doc_comment_3() {
         let comment = "/**\n let a: *int;\n *a = 5;\n*/";
         let stripped = strip_doc_comment_decoration(comment);
-        assert_eq!(stripped, ~" let a: *int;\n *a = 5;");
+        assert_eq!(stripped, " let a: *int;\n *a = 5;".to_owned());
     }
 
     #[test] fn test_block_doc_comment_4() {
         let comment = "/*******************\n test\n *********************/";
         let stripped = strip_doc_comment_decoration(comment);
-        assert_eq!(stripped, ~" test");
+        assert_eq!(stripped, " test".to_owned());
     }
 
     #[test] fn test_line_doc_comment() {
         let stripped = strip_doc_comment_decoration("/// test");
-        assert_eq!(stripped, ~" test");
+        assert_eq!(stripped, " test".to_owned());
         let stripped = strip_doc_comment_decoration("///! test");
-        assert_eq!(stripped, ~" test");
+        assert_eq!(stripped, " test".to_owned());
         let stripped = strip_doc_comment_decoration("// test");
-        assert_eq!(stripped, ~" test");
+        assert_eq!(stripped, " test".to_owned());
         let stripped = strip_doc_comment_decoration("// test");
-        assert_eq!(stripped, ~" test");
+        assert_eq!(stripped, " test".to_owned());
         let stripped = strip_doc_comment_decoration("///test");
-        assert_eq!(stripped, ~"test");
+        assert_eq!(stripped, "test".to_owned());
         let stripped = strip_doc_comment_decoration("///!test");
-        assert_eq!(stripped, ~"test");
+        assert_eq!(stripped, "test".to_owned());
         let stripped = strip_doc_comment_decoration("//test");
-        assert_eq!(stripped, ~"test");
+        assert_eq!(stripped, "test".to_owned());
     }
 }