From 1bdadfae1bdef6ce12b6e7c98be94e6cfc601630 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Mon, 8 Jul 2019 16:04:19 +0200 Subject: [PATCH] Make code compatible with Rust 2018 --- Cargo.toml | 1 + src/lib.rs | 12 ++++++------ tests/histogram.rs | 2 +- tests/proptest.rs | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 177fdcd..1ffa503 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ name = "average" readme = "README.md" repository = "https://github.com/vks/average" version = "0.10.0" +edition = "2018" [features] serde1 = ["serde", "serde_derive", "serde-big-array"] diff --git a/src/lib.rs b/src/lib.rs index 83e60c7..e495e9c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -108,12 +108,12 @@ mod quantile; mod traits; #[macro_use] mod histogram; -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, Histogram}; +pub use crate::moments::{Mean, Variance, Skewness, Kurtosis, MeanWithError}; +pub use crate::weighted_mean::{WeightedMean, WeightedMeanWithError}; +pub use crate::minmax::{Min, Max}; +pub use crate::quantile::Quantile; +pub use crate::traits::{Estimate, Merge, Histogram}; define_histogram!(hist, 10); -pub use hist::Histogram as Histogram10; +pub use crate::hist::Histogram as Histogram10; define_moments!(Moments4, 4); diff --git a/tests/histogram.rs b/tests/histogram.rs index e4a8790..11b6065 100644 --- a/tests/histogram.rs +++ b/tests/histogram.rs @@ -20,7 +20,7 @@ use average::{Histogram, Merge}; define_histogram!(hist10, 10); define_histogram!(hist100, 100); -use hist10::Histogram as Histogram10; +use crate::hist10::Histogram as Histogram10; #[test] fn with_const_width() { diff --git a/tests/proptest.rs b/tests/proptest.rs index 4a28e2c..90bb294 100644 --- a/tests/proptest.rs +++ b/tests/proptest.rs @@ -9,7 +9,7 @@ use core::iter::Iterator; use average::Mean; use proptest::prelude::*; -use prop::num::f64; +use crate::prop::num::f64; proptest! { #![proptest_config(ProptestConfig::with_cases(10000))]