Fix serde1 feature and remove unneccessary crate import

This commit is contained in:
Vinzent Steinberg 2019-07-08 17:28:00 +02:00
parent 610f6cae6a
commit 31a8154e01
7 changed files with 8 additions and 3 deletions

View File

@ -29,7 +29,7 @@ name = "kurtosis"
[dependencies]
num-traits = "0.2"
float-ord = "0.2"
serde = { version = "1", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_derive = { version = "1", optional = true }
serde-big-array = { version = "0.1.4", optional = true }

View File

@ -24,6 +24,7 @@ macro_rules! define_histogram {
($name:ident, $LEN:expr) => (
mod $name {
use $crate::Histogram as Trait;
#[cfg(feature = "serde1")] use ::serde::{Serialize, Deserialize};
#[cfg(feature = "serde1")] serde_big_array::big_array! {
BigArray; LEN, (LEN + 1),
}

View File

@ -1,5 +1,7 @@
use core;
#[cfg(feature = "serde1")] use serde::{Serialize, Deserialize};
use super::{Estimate, Merge};
/// Calculate the minimum of `a` and `b`.

View File

@ -1,6 +1,7 @@
use core;
use conv::ApproxFrom;
#[cfg(feature = "serde1")] use serde::{Serialize, Deserialize};
use super::{Estimate, Merge};
@ -55,6 +56,7 @@ macro_rules! define_moments {
($name:ident, $MAX_MOMENT:expr) => (
use ::conv::ApproxFrom;
use ::num_traits::pow;
#[cfg(feature = "serde1")] use ::serde::{Serialize, Deserialize};
/// An iterator over binomial coefficients.
struct IterBinomial {

View File

@ -3,6 +3,7 @@ use core::cmp::min;
use conv::{ApproxFrom, ConvAsUtil, ConvUtil, ValueFrom};
use float_ord::sort as sort_floats;
#[cfg(feature = "serde1")] use serde::{Serialize, Deserialize};
use super::Estimate;

View File

@ -1,5 +1,6 @@
use core;
#[cfg(feature = "serde1")] use serde::{Serialize, Deserialize};
use super::{MeanWithError, Estimate, Merge};

View File

@ -1,7 +1,5 @@
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, map_clone))]
#[macro_use] extern crate proptest;
use core::iter::Iterator;
use average::Mean;