Negative case of len() -> is_empty()

`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
This commit is contained in:
Tamir Duberstein 2015-03-24 16:54:09 -07:00
parent 29ac04402d
commit 10f15e72e6
61 changed files with 142 additions and 142 deletions

View file

@ -457,7 +457,7 @@ pub fn parse(sess: &ParseSess,
return Failure(sp, "unexpected end of macro invocation".to_string());
}
} else {
if (bb_eis.len() > 0 && next_eis.len() > 0)
if (!bb_eis.is_empty() && !next_eis.is_empty())
|| bb_eis.len() > 1 {
let nts = bb_eis.iter().map(|ei| {
match ei.top_elts.get_tt(ei.idx) {
@ -475,9 +475,9 @@ pub fn parse(sess: &ParseSess,
} else if bb_eis.is_empty() && next_eis.is_empty() {
return Failure(sp, format!("no rules expected the token `{}`",
pprust::token_to_string(&tok)).to_string());
} else if next_eis.len() > 0 {
} else if !next_eis.is_empty() {
/* Now process the next token */
while next_eis.len() > 0 {
while !next_eis.is_empty() {
cur_eis.push(next_eis.pop().unwrap());
}
rdr.next_token();
@ -504,7 +504,7 @@ pub fn parse(sess: &ParseSess,
}
}
assert!(cur_eis.len() > 0);
assert!(!cur_eis.is_empty());
}
}