Skip to content

Commit

Permalink
fix clippy (#1927)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSeitz authored Mar 13, 2023
1 parent 0645181 commit 61cfd8d
Show file tree
Hide file tree
Showing 8 changed files with 756 additions and 598 deletions.
4 changes: 2 additions & 2 deletions examples/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ fn main() -> tantivy::Result<()> {

let agg_req: Aggregations = vec![(
"group_by_stock".to_string(),
Aggregation::Bucket(BucketAggregation {
Aggregation::Bucket(Box::new(BucketAggregation {
bucket_agg: BucketAggregationType::Range(RangeAggregation {
field: "stock".to_string(),
ranges: vec![
Expand Down Expand Up @@ -234,7 +234,7 @@ fn main() -> tantivy::Result<()> {
)]
.into_iter()
.collect(),
}),
})),
)]
.into_iter()
.collect();
Expand Down
18 changes: 9 additions & 9 deletions src/aggregation/agg_req.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
//! let agg_req1: Aggregations = vec![
//! (
//! "range".to_string(),
//! Aggregation::Bucket(BucketAggregation {
//! Aggregation::Bucket(Box::new(BucketAggregation {
//! bucket_agg: BucketAggregationType::Range(RangeAggregation{
//! field: "score".to_string(),
//! ranges: vec![(3f64..7f64).into(), (7f64..20f64).into()],
//! keyed: false,
//! }),
//! sub_aggregation: Default::default(),
//! }),
//! })),
//! ),
//! ]
//! .into_iter()
Expand Down Expand Up @@ -143,7 +143,7 @@ pub fn get_fast_field_names(aggs: &Aggregations) -> HashSet<String> {
#[serde(untagged)]
pub enum Aggregation {
/// Bucket aggregation, see [`BucketAggregation`] for details.
Bucket(BucketAggregation),
Bucket(Box<BucketAggregation>),
/// Metric aggregation, see [`MetricAggregation`] for details.
Metric(MetricAggregation),
}
Expand Down Expand Up @@ -301,7 +301,7 @@ mod tests {
fn serialize_to_json_test() {
let agg_req1: Aggregations = vec![(
"range".to_string(),
Aggregation::Bucket(BucketAggregation {
Aggregation::Bucket(Box::new(BucketAggregation {
bucket_agg: BucketAggregationType::Range(RangeAggregation {
field: "score".to_string(),
ranges: vec![
Expand All @@ -313,7 +313,7 @@ mod tests {
keyed: true,
}),
sub_aggregation: Default::default(),
}),
})),
)]
.into_iter()
.collect();
Expand Down Expand Up @@ -351,7 +351,7 @@ mod tests {
let agg_req2: Aggregations = vec![
(
"range".to_string(),
Aggregation::Bucket(BucketAggregation {
Aggregation::Bucket(Box::new(BucketAggregation {
bucket_agg: BucketAggregationType::Range(RangeAggregation {
field: "score2".to_string(),
ranges: vec![
Expand All @@ -363,7 +363,7 @@ mod tests {
..Default::default()
}),
sub_aggregation: Default::default(),
}),
})),
),
(
"metric".to_string(),
Expand All @@ -377,7 +377,7 @@ mod tests {

let agg_req1: Aggregations = vec![(
"range".to_string(),
Aggregation::Bucket(BucketAggregation {
Aggregation::Bucket(Box::new(BucketAggregation {
bucket_agg: BucketAggregationType::Range(RangeAggregation {
field: "score".to_string(),
ranges: vec![
Expand All @@ -389,7 +389,7 @@ mod tests {
..Default::default()
}),
sub_aggregation: agg_req2,
}),
})),
)]
.into_iter()
.collect();
Expand Down
Loading

0 comments on commit 61cfd8d

Please sign in to comment.