From 2ad204a424a420ebe7a34bc236a2d0239b5812e9 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Sat, 1 Dec 2012 14:19:37 +1000 Subject: [PATCH] Add missing trait bounds --- src/angle.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/angle.rs b/src/angle.rs index d1c97ea..ce3c4bb 100644 --- a/src/angle.rs +++ b/src/angle.rs @@ -35,7 +35,8 @@ pub trait Angle: Add pub enum Radians = T; -pub impl Radians: Angle { +// FIXME: not sure why I need the Eq and Ord trait bounds, but Rust complains if I don't include them +pub impl Radians: Angle { #[inline(always)] static pure fn full_turn() -> Radians { Radians(move cast(2.0 * pi)) } // TODO: calculate absolute values #[inline(always)] static pure fn half_turn() -> Radians { Radians(move cast(pi)) } #[inline(always)] static pure fn quadrant() -> Radians { Radians(move cast(pi / 2.0)) } @@ -120,7 +121,8 @@ pub impl Radians: ToStr { pub enum Degrees = T; -pub impl Degrees: Angle { +// FIXME: not sure why I need the Eq and Ord trait bounds, but Rust complains if I don't include them +pub impl Degrees: Angle { #[inline(always)] static pure fn full_turn() -> Degrees { Degrees(move cast(360.0)) } #[inline(always)] static pure fn half_turn() -> Degrees { Degrees(move cast(180.0)) } #[inline(always)] static pure fn quadrant() -> Degrees { Degrees(move cast(90.0)) }