From 55a0acfbd4d2d4b669b1a0f215ec9c5ec992148d Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Mon, 29 Jan 2018 14:24:53 +0100 Subject: [PATCH 1/3] Implement serialization for the Angle type. --- Cargo.toml | 2 +- src/lib.rs | 1 + src/rotation.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 828b357e..15fe9d2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ unstable = [] [dependencies] num-traits = {version = "0.1.32", default-features = false} log = "0.3.1" -serde = "1.0" +serde = { version = "1.0", features = ["serde_derive"] } [dev-dependencies] rand = "0.3.7" diff --git a/src/lib.rs b/src/lib.rs index 7bf8b09a..4f22d479 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,6 +57,7 @@ #[cfg_attr(test, macro_use)] extern crate log; +#[macro_use] extern crate serde; extern crate num_traits; diff --git a/src/rotation.rs b/src/rotation.rs index d9619924..47ef41a7 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -17,7 +17,7 @@ use {TypedPoint2D, TypedPoint3D, TypedVector2D, TypedVector3D, Vector3D, point2, use {TypedTransform2D, TypedTransform3D, UnknownUnit}; /// An angle in radians -#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Hash)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Hash, Serialize, Deserialize)] pub struct Angle { pub radians: T, } From a76867362c354f9abdc6bdfb5c7b2441500e9f23 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Mon, 29 Jan 2018 14:26:44 +0100 Subject: [PATCH 2/3] Version 0.16.4 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 15fe9d2b..4f09ad86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "euclid" -version = "0.16.3" +version = "0.16.4" authors = ["The Servo Project Developers"] description = "Geometry primitives" documentation = "https://docs.rs/euclid/" From 1a119cad66b2c500f8e49d28d5b0fad673efc655 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Mon, 29 Jan 2018 14:27:55 +0100 Subject: [PATCH 3/3] Remove unnecessary log dependency. --- Cargo.toml | 1 - src/lib.rs | 2 -- src/transform3d.rs | 1 - 3 files changed, 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4f09ad86..485444d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ unstable = [] [dependencies] num-traits = {version = "0.1.32", default-features = false} -log = "0.3.1" serde = { version = "1.0", features = ["serde_derive"] } [dev-dependencies] diff --git a/src/lib.rs b/src/lib.rs index 4f22d479..10cc5a19 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,8 +55,6 @@ //! assert_eq!(p.x, p.x_typed().get()); //! ``` -#[cfg_attr(test, macro_use)] -extern crate log; #[macro_use] extern crate serde; diff --git a/src/transform3d.rs b/src/transform3d.rs index 7993ae76..2876c6c0 100644 --- a/src/transform3d.rs +++ b/src/transform3d.rs @@ -768,7 +768,6 @@ mod tests { 0.0, 0.0, -1.0, 0.0, -1.0, -1.22222222, -0.0, 1.0 ); - debug!("result={:?} expected={:?}", result, expected); assert!(result.approx_eq(&expected)); }