From 57dfc14139299049f1339bc90fb89e65f0982399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Tue, 25 Feb 2014 09:41:41 +0100 Subject: [PATCH] Update to the last Rust. Version of rustc: 0.10-pre (4243cad 2014-02-24 22:17:02 -0800) --- src/structs/dmat.rs | 18 ------------------ src/structs/dvec.rs | 2 +- src/structs/iso.rs | 6 +++--- src/structs/mat.rs | 14 +++++++------- src/structs/rot.rs | 6 +++--- src/structs/vec.rs | 14 +++++++------- src/traits/operations.rs | 2 +- 7 files changed, 22 insertions(+), 40 deletions(-) diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index 9db4edc3..b60b287e 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -629,21 +629,3 @@ scalar_sub_impl!(i16) scalar_sub_impl!(i8) scalar_sub_impl!(uint) scalar_sub_impl!(int) - -impl ToStr for DMat { - fn to_str(&self) -> ~str { - let mut res = ~"DMat "; - res = res + self.nrows.to_str() + " " + self.ncols.to_str() + " {\n"; - - for i in range(0u, self.nrows) { - for j in range(0u, self.ncols) { - res = res + " " + unsafe { self.at_fast(i, j).to_str() }; - } - - res = res + "\n"; - } - res = res + "}"; - - res - } -} diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index 1034dfa6..96023415 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -16,7 +16,7 @@ use traits::structure::{Iterable, IterableMut}; mod metal; /// Vector with a dimension unknown at compile-time. -#[deriving(Eq, Show, ToStr, Clone)] +#[deriving(Eq, Show, Clone)] pub struct DVec { /// Components of the vector. Contains as much elements as the vector dimension. at: ~[N] diff --git a/src/structs/iso.rs b/src/structs/iso.rs index 2819c16e..3ff15e96 100644 --- a/src/structs/iso.rs +++ b/src/structs/iso.rs @@ -20,7 +20,7 @@ mod iso_macros; /// /// This is the composition of a rotation followed by a translation. /// Isometries conserve angles and distances, hence do not allow shearing nor scaling. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show)] pub struct Iso2 { /// The rotation applicable by this isometry. rotation: Rot2, @@ -32,7 +32,7 @@ pub struct Iso2 { /// /// This is the composition of a rotation followed by a translation. /// Isometries conserve angles and distances, hence do not allow shearing nor scaling. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show)] pub struct Iso3 { /// The rotation applicable by this isometry. rotation: Rot3, @@ -43,7 +43,7 @@ pub struct Iso3 { /// Four dimensional isometry. /// /// Isometries conserve angles and distances, hence do not allow shearing nor scaling. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show)] pub struct Iso4 { /// The rotation applicable by this isometry. rotation: Rot4, diff --git a/src/structs/mat.rs b/src/structs/mat.rs index ebfadc50..2cdafa71 100644 --- a/src/structs/mat.rs +++ b/src/structs/mat.rs @@ -17,7 +17,7 @@ mod metal; mod mat_macros; /// Special identity matrix. All its operation are no-ops. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Rand, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Rand, Show)] pub struct Identity; impl Identity { @@ -29,7 +29,7 @@ impl Identity { } /// Square matrix of dimension 1. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Mat1 { m11: N } @@ -121,7 +121,7 @@ from_homogeneous_impl!(Mat1, Mat2, 1, 2) outer_impl!(Vec1, Mat1) /// Square matrix of dimension 2. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Mat2 { m11: N, m21: N, m12: N, m22: N @@ -218,7 +218,7 @@ from_homogeneous_impl!(Mat2, Mat3, 2, 3) outer_impl!(Vec2, Mat2) /// Square matrix of dimension 3. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Mat3 { m11: N, m21: N, m31: N, m12: N, m22: N, m32: N, @@ -329,7 +329,7 @@ from_homogeneous_impl!(Mat3, Mat4, 3, 4) outer_impl!(Vec3, Mat3) /// Square matrix of dimension 4. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Mat4 { m11: N, m21: N, m31: N, m41: N, m12: N, m22: N, m32: N, m42: N, @@ -492,7 +492,7 @@ from_homogeneous_impl!(Mat4, Mat5, 4, 5) outer_impl!(Vec4, Mat4) /// Square matrix of dimension 5. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Mat5 { m11: N, m21: N, m31: N, m41: N, m51: N, m12: N, m22: N, m32: N, m42: N, m52: N, @@ -671,7 +671,7 @@ from_homogeneous_impl!(Mat5, Mat6, 5, 6) outer_impl!(Vec5, Mat5) /// Square matrix of dimension 6. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Mat6 { m11: N, m21: N, m31: N, m41: N, m51: N, m61: N, m12: N, m22: N, m32: N, m42: N, m52: N, m62: N, diff --git a/src/structs/rot.rs b/src/structs/rot.rs index 0ea77f36..5577adf8 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -15,7 +15,7 @@ mod metal; mod rot_macros; /// Two dimensional rotation matrix. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, ToStr, Hash)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, Hash)] pub struct Rot2 { priv submat: Mat2 } @@ -93,7 +93,7 @@ impl AbsoluteRotate> for Rot2 { * 3d rotation */ /// Three dimensional rotation matrix. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, ToStr, Hash)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, Hash)] pub struct Rot3 { priv submat: Mat3 } @@ -264,7 +264,7 @@ impl AbsoluteRotate> for Rot3 { } /// Four dimensional rotation matrix. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, ToStr, Hash)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, Hash)] pub struct Rot4 { priv submat: Mat4 } diff --git a/src/structs/vec.rs b/src/structs/vec.rs index 2f053a93..810e9308 100644 --- a/src/structs/vec.rs +++ b/src/structs/vec.rs @@ -17,11 +17,11 @@ mod metal; mod vec_macros; /// Vector of dimension 0. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Rand, Zero, Show)] pub struct Vec0; /// Vector of dimension 1. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Vec1 { /// First component of the vector. x: N @@ -117,7 +117,7 @@ rotate_impl!(Vec1) transform_impl!(Vec1) /// Vector of dimension 2. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Vec2 { /// First component of the vector. x: N, @@ -215,7 +215,7 @@ rotate_impl!(Vec2) transform_impl!(Vec2) /// Vector of dimension 3. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Vec3 { /// First component of the vector. x: N, @@ -319,7 +319,7 @@ transform_impl!(Vec3) /// Vector of dimension 4. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Vec4 { /// First component of the vector. x: N, @@ -421,7 +421,7 @@ rotate_impl!(Vec4) transform_impl!(Vec4) /// Vector of dimension 5. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Vec5 { /// First component of the vector. x: N, @@ -525,7 +525,7 @@ rotate_impl!(Vec5) transform_impl!(Vec5) /// Vector of dimension 6. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Hash, Rand, Zero, Show)] pub struct Vec6 { /// First component of the vector. x: N, diff --git a/src/traits/operations.rs b/src/traits/operations.rs index bc3e5c65..137af25f 100644 --- a/src/traits/operations.rs +++ b/src/traits/operations.rs @@ -4,7 +4,7 @@ use std::cmp; /// Result of a partial ordering. -#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show, ToStr)] +#[deriving(Eq, Encodable, Decodable, Clone, DeepClone, Show)] pub enum PartialOrdering { /// Result of a strict comparison. Less,