From 0469935161c4425ae56b514796a38424bc340644 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sat, 12 Sep 2015 13:07:22 +0200 Subject: [PATCH] fix rfc 1214 fallout --- src/matrix.rs | 8 ++++---- src/projection.rs | 2 +- src/rotation.rs | 18 +++++++++--------- src/transform.rs | 16 ++++++++-------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/matrix.rs b/src/matrix.rs index d683b73..d38df2c 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -323,10 +323,10 @@ impl> Matrix4 { } } -pub trait Matrix>: Array2 - + Zero + One - + ApproxEq - + Sized { +pub trait Matrix + 'static>: Array2 + + Zero + One + + ApproxEq + + Sized { /// Multiply this matrix by a scalar, returning the new matrix. #[must_use] fn mul_s(&self, s: S) -> Self; diff --git a/src/projection.rs b/src/projection.rs index 507db02..792548f 100644 --- a/src/projection.rs +++ b/src/projection.rs @@ -65,7 +65,7 @@ pub fn ortho(left: S, right: S, bottom: S, top: S, near: }.into() } -pub trait Projection: Into> { +pub trait Projection: Into> { fn to_frustum(&self) -> Frustum; } diff --git a/src/rotation.rs b/src/rotation.rs index 6c5419a..9b7541d 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -18,7 +18,7 @@ use approx::ApproxEq; use matrix::Matrix; use matrix::Matrix2; use matrix::Matrix3; -use num::{BaseNum, BaseFloat}; +use num::BaseFloat; use point::{Point, Point2, Point3}; use quaternion::Quaternion; use ray::Ray; @@ -26,7 +26,7 @@ use vector::{Vector, Vector2, Vector3}; /// A trait for a generic rotation. A rotation is a transformation that /// creates a circular motion, and preserves at least one point in the space. -pub trait Rotation, P: Point>: PartialEq + ApproxEq + Sized { +pub trait Rotation, P: Point>: PartialEq + ApproxEq + Sized { /// Create the identity transform (causes no transformation). fn identity() -> Self; @@ -74,19 +74,19 @@ pub trait Rotation, P: Point>: PartialEq + Approx } /// A two-dimensional rotation. -pub trait Rotation2: Rotation, Point2> - + Into> - + Into> { +pub trait Rotation2: Rotation, Point2> + + Into> + + Into> { /// Create a rotation by a given angle. Thus is a redundant case of both /// from_axis_angle() and from_euler() for 2D space. fn from_angle(theta: Rad) -> Self; } /// A three-dimensional rotation. -pub trait Rotation3: Rotation, Point3> - + Into> - + Into> - + Into> { +pub trait Rotation3: Rotation, Point3> + + Into> + + Into> + + Into> { /// Create a rotation using an angle around a given axis. fn from_axis_angle(axis: &Vector3, angle: Rad) -> Self; diff --git a/src/transform.rs b/src/transform.rs index 7485fd3..b94a0f6 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -146,8 +146,8 @@ impl< } } -pub trait Transform2: Transform, Point2> + Into> {} -pub trait Transform3: Transform, Point3> + Into> {} +pub trait Transform2: Transform, Point2> + Into> {} +pub trait Transform3: Transform, Point3> + Into> {} impl< S: BaseFloat + 'static, @@ -239,21 +239,21 @@ impl Transform3 for AffineMatrix3 {} /// A trait that allows extracting components (rotation, translation, scale) /// from an arbitrary transformations -pub trait ToComponents, P: Point, R: Rotation> { +pub trait ToComponents, P: Point, R: Rotation> { /// Extract the (scale, rotation, translation) triple fn decompose(&self) -> (V, R, V); } -pub trait ToComponents2>: +pub trait ToComponents2>: ToComponents, Point2, R> {} -pub trait ToComponents3>: +pub trait ToComponents3>: ToComponents, Point3, R> {} -pub trait CompositeTransform, P: Point, R: Rotation>: +pub trait CompositeTransform, P: Point, R: Rotation>: Transform + ToComponents {} -pub trait CompositeTransform2>: +pub trait CompositeTransform2>: Transform2 + ToComponents2 {} -pub trait CompositeTransform3>: +pub trait CompositeTransform3>: Transform3 + ToComponents3 {} impl<