Skip to content

Commit

Permalink
Auto merge of #265 - nical:serde-angle, r=SimonSapin
Browse files Browse the repository at this point in the history
Missing serde impl for Angle, and remove log dependency.

The Angle type was missing `Serialize` and `Deserialize` implementations, this PR  addresses that. In the process I removed the dependency to the log crate which was only used in one place in a test and wasn't really needed, and bumped euclid's own version from 0.16.3 to 0.16.4.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/265)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo authored Jan 29, 2018
2 parents ec9148a + 1a119ca commit 98b16d6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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/"
Expand All @@ -14,8 +14,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"
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
//! assert_eq!(p.x, p.x_typed().get());
//! ```

#[cfg_attr(test, macro_use)]
extern crate log;
#[macro_use]
extern crate serde;

extern crate num_traits;
Expand Down
2 changes: 1 addition & 1 deletion src/rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
pub radians: T,
}
Expand Down
1 change: 0 additions & 1 deletion src/transform3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 98b16d6

Please sign in to comment.