From d772bf2decc416b8cd836cb292b1cc81ac9808e7 Mon Sep 17 00:00:00 2001 From: PSeitz Date: Mon, 28 Aug 2023 08:41:12 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Paul Masurel --- src/aggregation/metric/average.rs | 2 +- src/aggregation/metric/count.rs | 2 +- src/aggregation/metric/max.rs | 2 +- src/aggregation/metric/min.rs | 2 +- src/aggregation/metric/stats.rs | 2 +- src/aggregation/metric/sum.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/aggregation/metric/average.rs b/src/aggregation/metric/average.rs index ed13c53fba..966ea10051 100644 --- a/src/aggregation/metric/average.rs +++ b/src/aggregation/metric/average.rs @@ -24,7 +24,7 @@ pub struct AverageAggregation { /// By default they will be ignored but it is also possible to treat them as if they had a /// value. Examples in JSON format: /// { "field": "my_numbers", "missing": "10.0" } - #[serde(skip_serializing_if = "Option::is_none", default)] + #[serde(default)] pub missing: Option, } diff --git a/src/aggregation/metric/count.rs b/src/aggregation/metric/count.rs index ca685d6670..bb298de8b7 100644 --- a/src/aggregation/metric/count.rs +++ b/src/aggregation/metric/count.rs @@ -24,7 +24,7 @@ pub struct CountAggregation { /// By default they will be ignored but it is also possible to treat them as if they had a /// value. Examples in JSON format: /// { "field": "my_numbers", "missing": "10.0" } - #[serde(skip_serializing_if = "Option::is_none", default)] + #[serde(default)] pub missing: Option, } diff --git a/src/aggregation/metric/max.rs b/src/aggregation/metric/max.rs index 674972f519..ec8a6c6088 100644 --- a/src/aggregation/metric/max.rs +++ b/src/aggregation/metric/max.rs @@ -24,7 +24,7 @@ pub struct MaxAggregation { /// By default they will be ignored but it is also possible to treat them as if they had a /// value. Examples in JSON format: /// { "field": "my_numbers", "missing": "10.0" } - #[serde(skip_serializing_if = "Option::is_none", default)] + #[serde(default)] pub missing: Option, } diff --git a/src/aggregation/metric/min.rs b/src/aggregation/metric/min.rs index 562e865d38..a1c4066df5 100644 --- a/src/aggregation/metric/min.rs +++ b/src/aggregation/metric/min.rs @@ -24,7 +24,7 @@ pub struct MinAggregation { /// By default they will be ignored but it is also possible to treat them as if they had a /// value. Examples in JSON format: /// { "field": "my_numbers", "missing": "10.0" } - #[serde(skip_serializing_if = "Option::is_none", default)] + #[serde(default)] pub missing: Option, } diff --git a/src/aggregation/metric/stats.rs b/src/aggregation/metric/stats.rs index 0432cd8e19..ac4aa5b728 100644 --- a/src/aggregation/metric/stats.rs +++ b/src/aggregation/metric/stats.rs @@ -33,7 +33,7 @@ pub struct StatsAggregation { /// By default they will be ignored but it is also possible to treat them as if they had a /// value. Examples in JSON format: /// { "field": "my_numbers", "missing": "10.0" } - #[serde(skip_serializing_if = "Option::is_none", default)] + #[serde(default)] pub missing: Option, } diff --git a/src/aggregation/metric/sum.rs b/src/aggregation/metric/sum.rs index f63c144be8..067350a17c 100644 --- a/src/aggregation/metric/sum.rs +++ b/src/aggregation/metric/sum.rs @@ -24,7 +24,7 @@ pub struct SumAggregation { /// By default they will be ignored but it is also possible to treat them as if they had a /// value. Examples in JSON format: /// { "field": "my_numbers", "missing": "10.0" } - #[serde(skip_serializing_if = "Option::is_none", default)] + #[serde(default)] pub missing: Option, }