clippy: fix len_zero warnings

This commit is contained in:
Laurentiu Nicola
2017-05-16 20:29:59 +03:00
committed by Paul Masurel
parent f5fb29422a
commit a67caee141
2 changed files with 3 additions and 3 deletions

View File

@@ -236,7 +236,7 @@ impl IndexMerger {
// We can remove the term if all documents which
// contained it have been deleted.
if segment_postings.len() > 0 {
if !segment_postings.is_empty() {
// We can now serialize this postings, by pushing each document to the
// postings serializer.

View File

@@ -222,7 +222,7 @@ impl QueryParser {
vec![(field, literal.phrase.clone())]
}
None => {
if self.default_fields.len() == 0 {
if self.default_fields.is_empty() {
return Err(QueryParserError::NoDefaultFieldDeclared);
} else {
self.default_fields
@@ -238,7 +238,7 @@ impl QueryParser {
asts.push(LogicalAST::Leaf(box ast));
}
}
let result_ast = if asts.len() == 0 {
let result_ast = if asts.is_empty() {
// this should never happen
return Err(QueryParserError::SyntaxError);
} else if asts.len() == 1 {