Merge pull request #32 from rlane/iterbytes
derive IterBytes for all structs
This commit is contained in:
commit
7435ae16bf
3 changed files with 5 additions and 5 deletions
|
@ -23,8 +23,8 @@ use std::num::{One, one, Zero, zero, cast};
|
|||
|
||||
use approx::ApproxEq;
|
||||
|
||||
#[deriving(Clone, Eq, Ord)] pub struct Rad<S> { s: S }
|
||||
#[deriving(Clone, Eq, Ord)] pub struct Deg<S> { s: S }
|
||||
#[deriving(Clone, Eq, Ord, IterBytes)] pub struct Rad<S> { s: S }
|
||||
#[deriving(Clone, Eq, Ord, IterBytes)] pub struct Deg<S> { s: S }
|
||||
|
||||
#[inline] pub fn rad<S: Float>(s: S) -> Rad<S> { Rad { s: s } }
|
||||
#[inline] pub fn deg<S: Float>(s: S) -> Deg<S> { Deg { s: s } }
|
||||
|
|
|
@ -24,11 +24,11 @@ use array::*;
|
|||
use vector::*;
|
||||
|
||||
/// A point in 2-dimensional space.
|
||||
#[deriving(Eq, Clone)]
|
||||
#[deriving(Eq, Clone, IterBytes)]
|
||||
pub struct Point2<S> { x: S, y: S }
|
||||
|
||||
/// A point in 3-dimensional space.
|
||||
#[deriving(Eq, Clone)]
|
||||
#[deriving(Eq, Clone, IterBytes)]
|
||||
pub struct Point3<S> { x: S, y: S, z: S }
|
||||
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ pub trait Vector
|
|||
// Utility macro for generating associated functions for the vectors
|
||||
macro_rules! vec(
|
||||
($Self:ident <$S:ident> { $($field:ident),+ }, $n:expr) => (
|
||||
#[deriving(Eq, Clone)]
|
||||
#[deriving(Eq, Clone, IterBytes)]
|
||||
pub struct $Self<S> { $($field: S),+ }
|
||||
|
||||
impl<$S: Primitive> $Self<$S> {
|
||||
|
|
Loading…
Reference in a new issue