summary refs log tree commit diff
path: root/src/libsyntax/parse
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
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')
-rw-r--r--src/libsyntax/parse/lexer/comments.rs4
-rw-r--r--src/libsyntax/parse/parser.rs4
2 files changed, 4 insertions, 4 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);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index fe5fbdccf61..071e5a69240 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2254,7 +2254,7 @@ impl<'a> Parser<'a> {
                         (Vec::new(), Vec::new(), Vec::new())
                     };
 
-                    if bindings.len() > 0 {
+                    if !bindings.is_empty() {
                         let last_span = self.last_span;
                         self.span_err(last_span, "type bindings are only permitted on trait paths");
                     }
@@ -3024,7 +3024,7 @@ impl<'a> Parser<'a> {
                 try!(self.expect(&token::Comma));
 
                 if self.token == token::CloseDelim(token::Bracket)
-                        && (before_slice || after.len() != 0) {
+                        && (before_slice || !after.is_empty()) {
                     break
                 }
             }