diff --git a/Cargo.toml b/Cargo.toml index 7ea6f8ba..d7576d62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ default = [ "std" ] std = [ "matrixmultiply", "rand/std", "rand_distr", "simba/std" ] stdweb = [ "rand/stdweb" ] arbitrary = [ "quickcheck" ] -serde-serialize = [ "serde", "serde_derive", "num-complex/serde" ] +serde-serialize = [ "serde", "num-complex/serde" ] abomonation-serialize = [ "abomonation" ] sparse = [ ] 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 } rand_distr = { version = "0.2", optional = true } matrixmultiply = { version = "0.2", optional = true } -serde = { version = "1.0", optional = true } -serde_derive = { version = "1.0", optional = true } +serde = { version = "1.0", features = [ "derive" ], optional = true } abomonation = { version = "0.7", optional = true } mint = { version = "0.5", optional = true } quickcheck = { version = "0.9", optional = true } diff --git a/src/lib.rs b/src/lib.rs index 9db176bf..fbc0a27d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,11 +90,9 @@ an optimized set of tools for computer graphics and physics. Those features incl #[cfg(feature = "arbitrary")] extern crate quickcheck; -#[cfg(feature = "serde")] -extern crate serde; -#[cfg(feature = "serde")] +#[cfg(feature = "serde-serialize")] #[macro_use] -extern crate serde_derive; +extern crate serde; #[cfg(feature = "abomonation-serialize")] extern crate abomonation; @@ -190,9 +188,7 @@ pub fn zero() -> T { /// The range must not be empty. #[inline] pub fn wrap(mut val: T, min: T, max: T) -> T -where - T: Copy + PartialOrd + ClosedAdd + ClosedSub, -{ +where T: Copy + PartialOrd + ClosedAdd + ClosedSub { assert!(min < max, "Invalid wrapping bounds."); 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) #[inline] pub fn center(p1: &Point, p2: &Point) -> Point -where - DefaultAllocator: Allocator, -{ +where DefaultAllocator: Allocator { ((&p1.coords + &p2.coords) * convert::<_, N>(0.5)).into() }