Don't depend on serde_derive explicitly.

This commit is contained in:
sebcrozet 2020-07-12 10:47:16 +02:00 committed by Sébastien Crozet
parent 6300d34356
commit 7c69cbf326
2 changed files with 6 additions and 13 deletions

View File

@ -24,7 +24,7 @@ default = [ "std" ]
std = [ "matrixmultiply", "rand/std", "rand_distr", "simba/std" ] std = [ "matrixmultiply", "rand/std", "rand_distr", "simba/std" ]
stdweb = [ "rand/stdweb" ] stdweb = [ "rand/stdweb" ]
arbitrary = [ "quickcheck" ] arbitrary = [ "quickcheck" ]
serde-serialize = [ "serde", "serde_derive", "num-complex/serde" ] serde-serialize = [ "serde", "num-complex/serde" ]
abomonation-serialize = [ "abomonation" ] abomonation-serialize = [ "abomonation" ]
sparse = [ ] sparse = [ ]
debug = [ "approx/num-complex", "rand/std" ] debug = [ "approx/num-complex", "rand/std" ]
@ -44,8 +44,7 @@ simba = { version = "0.1", default-features = false }
alga = { version = "0.9", default-features = false, optional = true } alga = { version = "0.9", default-features = false, optional = true }
rand_distr = { version = "0.2", optional = true } rand_distr = { version = "0.2", optional = true }
matrixmultiply = { version = "0.2", optional = true } matrixmultiply = { version = "0.2", optional = true }
serde = { version = "1.0", optional = true } serde = { version = "1.0", features = [ "derive" ], optional = true }
serde_derive = { version = "1.0", optional = true }
abomonation = { version = "0.7", optional = true } abomonation = { version = "0.7", optional = true }
mint = { version = "0.5", optional = true } mint = { version = "0.5", optional = true }
quickcheck = { version = "0.9", optional = true } quickcheck = { version = "0.9", optional = true }

View File

@ -90,11 +90,9 @@ an optimized set of tools for computer graphics and physics. Those features incl
#[cfg(feature = "arbitrary")] #[cfg(feature = "arbitrary")]
extern crate quickcheck; extern crate quickcheck;
#[cfg(feature = "serde")] #[cfg(feature = "serde-serialize")]
extern crate serde;
#[cfg(feature = "serde")]
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde;
#[cfg(feature = "abomonation-serialize")] #[cfg(feature = "abomonation-serialize")]
extern crate abomonation; extern crate abomonation;
@ -190,9 +188,7 @@ pub fn zero<T: Zero>() -> T {
/// The range must not be empty. /// The range must not be empty.
#[inline] #[inline]
pub fn wrap<T>(mut val: T, min: T, max: T) -> T pub fn wrap<T>(mut val: T, min: T, max: T) -> T
where where T: Copy + PartialOrd + ClosedAdd + ClosedSub {
T: Copy + PartialOrd + ClosedAdd + ClosedSub,
{
assert!(min < max, "Invalid wrapping bounds."); assert!(min < max, "Invalid wrapping bounds.");
let width = max - min; let width = max - min;
@ -392,9 +388,7 @@ pub fn partial_sort2<'a, T: PartialOrd>(a: &'a T, b: &'a T) -> Option<(&'a T, &'
/// * [distance_squared](fn.distance_squared.html) /// * [distance_squared](fn.distance_squared.html)
#[inline] #[inline]
pub fn center<N: SimdComplexField, D: DimName>(p1: &Point<N, D>, p2: &Point<N, D>) -> Point<N, D> pub fn center<N: SimdComplexField, D: DimName>(p1: &Point<N, D>, p2: &Point<N, D>) -> Point<N, D>
where where DefaultAllocator: Allocator<N, D> {
DefaultAllocator: Allocator<N, D>,
{
((&p1.coords + &p2.coords) * convert::<_, N>(0.5)).into() ((&p1.coords + &p2.coords) * convert::<_, N>(0.5)).into()
} }