From 1a8a52b8e170309d63f1a10ff318720d8aa3db30 Mon Sep 17 00:00:00 2001 From: kraktus <56031107+kraktus@users.noreply.github.com> Date: Tue, 6 Sep 2022 11:47:55 +0200 Subject: [PATCH] Derive `Default` for `TypedMinMax` --- src/cmd/stats.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/cmd/stats.rs b/src/cmd/stats.rs index 64572a7b..6c850fe2 100644 --- a/src/cmd/stats.rs +++ b/src/cmd/stats.rs @@ -510,7 +510,7 @@ impl Commute for TypedSum { /// TypedMinMax keeps track of minimum/maximum values for each possible type /// where min/max makes sense. -#[derive(Clone)] +#[derive(Clone, Default)] struct TypedMinMax { strings: MinMax>, str_len: MinMax, @@ -586,17 +586,6 @@ impl TypedMinMax { } } -impl Default for TypedMinMax { - fn default() -> TypedMinMax { - TypedMinMax { - strings: Default::default(), - str_len: Default::default(), - integers: Default::default(), - floats: Default::default(), - } - } -} - impl Commute for TypedMinMax { fn merge(&mut self, other: TypedMinMax) { self.strings.merge(other.strings);