about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer/comments.rs
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2015-03-24 16:54:09 -0700
committerTamir Duberstein <tamird@gmail.com>2015-04-14 20:26:03 -0700
commit10f15e72e6c265eb43d34dba564d86dbf1c4fb99 (patch)
treed7032704f432c471748b1259d03975fef6e80eb0 /src/libsyntax/parse/lexer/comments.rs
parent29ac04402d53d358a1f6200bea45a301ff05b2d1 (diff)
downloadrust-10f15e72e6c265eb43d34dba564d86dbf1c4fb99.tar.gz
rust-10f15e72e6c265eb43d34dba564d86dbf1c4fb99.zip
Negative case of `len()` -> `is_empty()`
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
Diffstat (limited to 'src/libsyntax/parse/lexer/comments.rs')
-rw-r--r--src/libsyntax/parse/lexer/comments.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs
index 277f5365db3..bda01d5a654 100644
--- a/src/libsyntax/parse/lexer/comments.rs
+++ b/src/libsyntax/parse/lexer/comments.rs
@@ -63,7 +63,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> String {
         let mut i = 0;
         let mut j = lines.len();
         // first line of all-stars should be omitted
-        if lines.len() > 0 &&
+        if !lines.is_empty() &&
                 lines[0].chars().all(|c| c == '*') {
             i += 1;
         }
@@ -294,7 +294,7 @@ fn read_block_comment(rdr: &mut StringReader,
                 }
             }
         }
-        if curr_line.len() != 0 {
+        if !curr_line.is_empty() {
             trim_whitespace_prefix_and_push_line(&mut lines,
                                                  curr_line,
                                                  col);