More code deduplication

This commit is contained in:
Vinzent Steinberg 2017-06-23 17:43:42 +02:00
parent 9313307ae9
commit d5b3fc80ab
2 changed files with 3 additions and 11 deletions

View File

@ -76,8 +76,10 @@ mod weighted_mean;
mod minmax;
mod reduce;
mod quantile;
mod traits;
pub use moments::{Mean, Variance, Skewness, Kurtosis, MeanWithError};
pub use weighted_mean::{WeightedMean, WeightedMeanWithError};
pub use minmax::{Min, Max};
pub use quantile::Quantile;
pub use traits::{Estimate, Merge};

View File

@ -83,17 +83,7 @@ impl core::default::Default for Min {
}
}
impl core::iter::FromIterator<f64> for Min {
fn from_iter<T>(iter: T) -> Min
where T: IntoIterator<Item=f64>
{
let mut a = Min::new();
for i in iter {
a.add(i);
}
a
}
}
impl_from_iterator!(Min);
/// Estimate the maximum of a sequence of numbers ("population").
///