From 78555ec7806d21e1be94e0a19edf1c905dbe78fc Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Sun, 16 Apr 2017 16:35:08 +1000 Subject: [PATCH] Drop rustc-serialize support According to [Rust release milestone predictions](https://internals.rust-lang.org/t/rust-release-milestone-predictions/4591?u=dtolnay), rustc-serialize is scheduled to be deprecated in next month's beta release of Rust. Closes #395 --- Cargo.toml | 2 -- src/angle.rs | 2 -- src/euler.rs | 1 - src/lib.rs | 3 --- src/matrix.rs | 3 --- src/point.rs | 3 --- src/projection.rs | 2 -- src/quaternion.rs | 1 - src/rotation.rs | 2 -- src/transform.rs | 1 - src/vector.rs | 4 ---- 11 files changed, 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6b03238..a695354 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ name = "cgmath" [features] unstable = [] -default = ["rustc-serialize"] eders = ["serde", "serde_derive"] use_simd = ["simd"] @@ -36,7 +35,6 @@ use_simd = ["simd"] approx = "0.1" num-traits = "0.1" rand = "0.3" -rustc-serialize = { version = "0.3", optional = true } serde = { version = "0.9", optional = true } serde_derive = { version = "0.9", optional = true } simd = { version = "0.2", optional = true } diff --git a/src/angle.rs b/src/angle.rs index c1fa517..2d3d21c 100644 --- a/src/angle.rs +++ b/src/angle.rs @@ -33,7 +33,6 @@ use num::BaseFloat; /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(Copy, Clone, PartialEq, PartialOrd)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Rad(pub S); @@ -42,7 +41,6 @@ pub struct Rad(pub S); /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(Copy, Clone, PartialEq, PartialOrd)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Deg(pub S); diff --git a/src/euler.rs b/src/euler.rs index 4211d05..8c8bfaa 100644 --- a/src/euler.rs +++ b/src/euler.rs @@ -75,7 +75,6 @@ use num::BaseFloat; #[repr(C)] #[derive(Copy, Clone, Debug)] #[derive(PartialEq, Eq)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Euler { /// The angle to apply around the _x_ axis. Also known at the _pitch_. diff --git a/src/lib.rs b/src/lib.rs index abdf7c0..9262a8c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,9 +57,6 @@ extern crate approx; pub extern crate num_traits; extern crate rand; -#[cfg(feature = "rustc-serialize")] -extern crate rustc_serialize; - #[cfg(feature = "eders")] #[macro_use] extern crate serde_derive; diff --git a/src/matrix.rs b/src/matrix.rs index e900c66..b45dca2 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -36,7 +36,6 @@ use vector::{Vector2, Vector3, Vector4}; /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(Copy, Clone, PartialEq)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Matrix2 { /// The first column of the matrix. @@ -50,7 +49,6 @@ pub struct Matrix2 { /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(Copy, Clone, PartialEq)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Matrix3 { /// The first column of the matrix. @@ -66,7 +64,6 @@ pub struct Matrix3 { /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(Copy, Clone, PartialEq)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Matrix4 { /// The first column of the matrix. diff --git a/src/point.rs b/src/point.rs index 92ab046..3357672 100644 --- a/src/point.rs +++ b/src/point.rs @@ -33,7 +33,6 @@ use vector::{Vector1, Vector2, Vector3, Vector4}; /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(PartialEq, Eq, Copy, Clone, Hash)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Point1 { pub x: S, @@ -44,7 +43,6 @@ pub struct Point1 { /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(PartialEq, Eq, Copy, Clone, Hash)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Point2 { pub x: S, @@ -56,7 +54,6 @@ pub struct Point2 { /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(PartialEq, Eq, Copy, Clone, Hash)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Point3 { pub x: S, diff --git a/src/projection.rs b/src/projection.rs index d650aa6..ad24e83 100644 --- a/src/projection.rs +++ b/src/projection.rs @@ -135,7 +135,6 @@ impl From> for Matrix4 { /// A perspective projection with arbitrary left/right/bottom/top distances #[derive(Copy, Clone, Debug, PartialEq)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Perspective { pub left: S, @@ -183,7 +182,6 @@ impl From> for Matrix4 { /// An orthographic projection with arbitrary left/right/bottom/top distances #[derive(Copy, Clone, Debug, PartialEq)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Ortho { pub left: S, diff --git a/src/quaternion.rs b/src/quaternion.rs index 5fe0271..2c6189f 100644 --- a/src/quaternion.rs +++ b/src/quaternion.rs @@ -39,7 +39,6 @@ use simd::f32x4 as Simdf32x4; /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Quaternion { /// The scalar part of the quaternion. diff --git a/src/rotation.rs b/src/rotation.rs index 566c23d..4a25101 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -140,7 +140,6 @@ pub trait Rotation3: Rotation> /// // assert_ulps_eq!(&unit_y3, &unit_y2); // TODO: Figure out how to use this /// ``` #[derive(PartialEq, Copy, Clone)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Basis2 { mat: Matrix2 @@ -234,7 +233,6 @@ impl fmt::Debug for Basis2 { /// `math::Matrix3`. To ensure orthogonality is maintained, the operations have /// been restricted to a subset of those implemented on `Matrix3`. #[derive(PartialEq, Copy, Clone)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Basis3 { mat: Matrix3 diff --git a/src/transform.rs b/src/transform.rs index 91bff72..e28a32e 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -57,7 +57,6 @@ pub trait Transform: Sized { /// A generic transformation consisting of a rotation, /// displacement vector and scale amount. #[derive(Copy, Clone, Debug)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] pub struct Decomposed { pub scale: V::Scalar, pub rot: R, diff --git a/src/vector.rs b/src/vector.rs index ded4e77..f645f3e 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -37,7 +37,6 @@ use simd::u32x4 as Simdu32x4; /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(PartialEq, Eq, Copy, Clone, Hash)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Vector1 { /// The x component of the vector. @@ -49,7 +48,6 @@ pub struct Vector1 { /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(PartialEq, Eq, Copy, Clone, Hash)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Vector2 { /// The x component of the vector. @@ -63,7 +61,6 @@ pub struct Vector2 { /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(PartialEq, Eq, Copy, Clone, Hash)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Vector3 { /// The x component of the vector. @@ -79,7 +76,6 @@ pub struct Vector3 { /// This type is marked as `#[repr(C)]`. #[repr(C)] #[derive(PartialEq, Eq, Copy, Clone, Hash)] -#[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "eders", derive(Serialize, Deserialize))] pub struct Vector4 { /// The x component of the vector.