clippy: fix len_zero warnings

This commit is contained in:
Laurentiu Nicola
2017-05-17 15:50:07 +09:00
committed by Paul Masurel
parent f5fb29422a
commit a67caee141
2 changed files with 3 additions and 3 deletions
+1 -1
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.
+2 -2
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 {