diff options
author | Daniel Schadt <kingdread@gmx.de> | 2018-06-13 13:25:45 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2018-06-13 13:25:45 +0200 |
commit | 1857d5b73fdf137a23b8266b923047f8cc07bd49 (patch) | |
tree | 3edef2bd408357aa1b0304790edf21fd8fe05c1a | |
parent | 2fe671951369b8f049e8acf02e9e9750c96b4dcd (diff) | |
download | evtclib-1857d5b73fdf137a23b8266b923047f8cc07bd49.tar.gz evtclib-1857d5b73fdf137a23b8266b923047f8cc07bd49.tar.bz2 evtclib-1857d5b73fdf137a23b8266b923047f8cc07bd49.zip |
fix Default impl for RecordFunc
Deriving it puts the Default trait bound on X, T and D, even though this
is not necessary.
-rw-r--r-- | src/statistics/math.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/statistics/math.rs b/src/statistics/math.rs index 6e7e666..f0b0384 100644 --- a/src/statistics/math.rs +++ b/src/statistics/math.rs @@ -45,7 +45,7 @@ struct Record<X, T, D> { /// * `T` tag for each data point. Can be arbitrary. /// * `D` actual data. Must be [`Monoid`](trait.Monoid.html), so that it can be /// summed up. -#[derive(Clone, Default)] +#[derive(Clone)] pub struct RecordFunc<X, T, D> { data: Vec<Record<X, T, D>>, } @@ -138,6 +138,12 @@ where } } +impl<X: Ord, T, D: Monoid> Default for RecordFunc<X, T, D> { + fn default() -> Self { + Self::new() + } +} + #[cfg(test)] mod test { use super::*; |