Skip to content

Commit

Permalink
Clippy warnings fixes (#1885)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton authored Feb 20, 2023
1 parent 02bebf4 commit e2aa5af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
7 changes: 2 additions & 5 deletions examples/fuzzy_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
// - index a few documents into our index
// - search for the best document matching a basic query
// - retrieve the best document's original content.

use std::collections::HashSet;

// ---
// Importing tantivy...
use tantivy::collector::{Count, TopDocs};
use tantivy::query::{FuzzyTermQuery, QueryParser};
use tantivy::query::FuzzyTermQuery;
use tantivy::schema::*;
use tantivy::{doc, DocId, Index, ReloadPolicy, Score, SegmentReader};
use tantivy::{doc, Index, ReloadPolicy};
use tempfile::TempDir;

fn main() -> tantivy::Result<()> {
Expand Down
13 changes: 3 additions & 10 deletions src/aggregation/segment_agg_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,25 +279,18 @@ impl GenericSegmentAggregationResultsCollector {
.iter()
.enumerate()
.map(|(accessor_idx, (_key, req))| {
Ok(build_bucket_segment_agg_collector(
req,
accessor_idx,
false,
)?)
build_bucket_segment_agg_collector(req, accessor_idx, false)
})
.collect::<crate::Result<Vec<Box<dyn SegmentAggregationCollector>>>>()?;
let metrics = req
.metrics
.iter()
.enumerate()
.map(|(accessor_idx, (_key, req))| {
Ok(build_metric_segment_agg_collector(
req,
accessor_idx,
false,
)?)
build_metric_segment_agg_collector(req, accessor_idx, false)
})
.collect::<crate::Result<Vec<Box<dyn SegmentAggregationCollector>>>>()?;

let metrics = if metrics.is_empty() {
None
} else {
Expand Down

0 comments on commit e2aa5af

Please sign in to comment.