about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-10-14 23:05:01 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-10-19 12:59:40 -0700
commit9d5d97b55d6487ee23b805bc1acbaa0669b82116 (patch)
treeb72dcf7045e331e94ea0f8658d088ab42d917935 /src/libsyntax/parse/lexer
parentfb169d5543c84e11038ba2d07b538ec88fb49ca6 (diff)
downloadrust-9d5d97b55d6487ee23b805bc1acbaa0669b82116.tar.gz
rust-9d5d97b55d6487ee23b805bc1acbaa0669b82116.zip
Remove a large amount of deprecated functionality
Spring cleaning is here! In the Fall! This commit removes quite a large amount
of deprecated functionality from the standard libraries. I tried to ensure that
only old deprecated functionality was removed.

This is removing lots and lots of deprecated features, so this is a breaking
change. Please consult the deprecation messages of the deleted code to see how
to migrate code forward if it still needs migration.

[breaking-change]
Diffstat (limited to 'src/libsyntax/parse/lexer')
-rw-r--r--src/libsyntax/parse/lexer/comments.rs16
-rw-r--r--src/libsyntax/parse/lexer/mod.rs6
2 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs
index c53638ed07d..551d15048f1 100644
--- a/src/libsyntax/parse/lexer/comments.rs
+++ b/src/libsyntax/parse/lexer/comments.rs
@@ -64,21 +64,21 @@ pub fn strip_doc_comment_decoration(comment: &str) -> String {
         let mut j = lines.len();
         // first line of all-stars should be omitted
         if lines.len() > 0 &&
-                lines.get(0).as_slice().chars().all(|c| c == '*') {
+                lines[0].as_slice().chars().all(|c| c == '*') {
             i += 1;
         }
-        while i < j && lines.get(i).as_slice().trim().is_empty() {
+        while i < j && lines[i].as_slice().trim().is_empty() {
             i += 1;
         }
         // like the first, a last line of all stars should be omitted
-        if j > i && lines.get(j - 1)
+        if j > i && lines[j - 1]
                          .as_slice()
                          .chars()
                          .skip(1)
                          .all(|c| c == '*') {
             j -= 1;
         }
-        while j > i && lines.get(j - 1).as_slice().trim().is_empty() {
+        while j > i && lines[j - 1].as_slice().trim().is_empty() {
             j -= 1;
         }
         return lines.slice(i, j).iter().map(|x| (*x).clone()).collect();
@@ -252,7 +252,7 @@ fn read_block_comment(rdr: &mut StringReader,
     // doc-comments are not really comments, they are attributes
     if (rdr.curr_is('*') && !rdr.nextch_is('*')) || rdr.curr_is('!') {
         while !(rdr.curr_is('*') && rdr.nextch_is('/')) && !rdr.is_eof() {
-            curr_line.push_char(rdr.curr.unwrap());
+            curr_line.push(rdr.curr.unwrap());
             rdr.bump();
         }
         if !rdr.is_eof() {
@@ -279,17 +279,17 @@ fn read_block_comment(rdr: &mut StringReader,
                 curr_line = String::new();
                 rdr.bump();
             } else {
-                curr_line.push_char(rdr.curr.unwrap());
+                curr_line.push(rdr.curr.unwrap());
                 if rdr.curr_is('/') && rdr.nextch_is('*') {
                     rdr.bump();
                     rdr.bump();
-                    curr_line.push_char('*');
+                    curr_line.push('*');
                     level += 1;
                 } else {
                     if rdr.curr_is('*') && rdr.nextch_is('/') {
                         rdr.bump();
                         rdr.bump();
-                        curr_line.push_char('/');
+                        curr_line.push('/');
                         level -= 1;
                     } else { rdr.bump(); }
                 }
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 38c985af370..55d071b8d60 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -180,7 +180,7 @@ impl<'a> StringReader<'a> {
     fn fatal_span_char(&self, from_pos: BytePos, to_pos: BytePos, m: &str, c: char) -> ! {
         let mut m = m.to_string();
         m.push_str(": ");
-        char::escape_default(c, |c| m.push_char(c));
+        char::escape_default(c, |c| m.push(c));
         self.fatal_span_(from_pos, to_pos, m.as_slice());
     }
 
@@ -189,7 +189,7 @@ impl<'a> StringReader<'a> {
     fn err_span_char(&self, from_pos: BytePos, to_pos: BytePos, m: &str, c: char) {
         let mut m = m.to_string();
         m.push_str(": ");
-        char::escape_default(c, |c| m.push_char(c));
+        char::escape_default(c, |c| m.push(c));
         self.err_span_(from_pos, to_pos, m.as_slice());
     }
 
@@ -1227,7 +1227,7 @@ impl<'a> StringReader<'a> {
     fn read_to_eol(&mut self) -> String {
         let mut val = String::new();
         while !self.curr_is('\n') && !self.is_eof() {
-            val.push_char(self.curr.unwrap());
+            val.push(self.curr.unwrap());
             self.bump();
         }
         if self.curr_is('\n') { self.bump(); }