mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-04 16:22:55 +00:00
clippy: fix len_zero warnings
This commit is contained in:
committed by
Paul Masurel
parent
f5fb29422a
commit
a67caee141
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user