diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-14 23:05:01 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-19 12:59:40 -0700 |
| commit | 9d5d97b55d6487ee23b805bc1acbaa0669b82116 (patch) | |
| tree | b72dcf7045e331e94ea0f8658d088ab42d917935 /src/libsyntax/parse/lexer/comments.rs | |
| parent | fb169d5543c84e11038ba2d07b538ec88fb49ca6 (diff) | |
| download | rust-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/comments.rs')
| -rw-r--r-- | src/libsyntax/parse/lexer/comments.rs | 16 |
1 files changed, 8 insertions, 8 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(); } } |
