Fixed issue #13

This commit is contained in:
Leo Lahti 2014-05-30 21:14:16 +00:00
parent 40c5f5deb8
commit f8ad8aa02b
4 changed files with 10 additions and 10 deletions

View File

@ -2,8 +2,8 @@
#![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait. #![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait.
use rand::Rand; use std::rand::Rand;
use rand; use std::rand;
use std::num::{One, Zero}; use std::num::{One, Zero};
use traits::operations::ApproxEq; use traits::operations::ApproxEq;
use std::mem; use std::mem;

View File

@ -3,8 +3,8 @@
#![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait. #![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait.
use std::num::{Zero, One, Float}; use std::num::{Zero, One, Float};
use rand::Rand; use std::rand::Rand;
use rand; use std::rand;
use std::slice::{Items, MutItems}; use std::slice::{Items, MutItems};
use traits::operations::ApproxEq; use traits::operations::ApproxEq;
use std::iter::FromIterator; use std::iter::FromIterator;

View File

@ -122,7 +122,7 @@ impl<N: Clone> Row<Vec3<N>> for Mat3<N> {
0 => Vec3::new(self.m11.clone(), self.m12.clone(), self.m13.clone()), 0 => Vec3::new(self.m11.clone(), self.m12.clone(), self.m13.clone()),
1 => Vec3::new(self.m21.clone(), self.m22.clone(), self.m23.clone()), 1 => Vec3::new(self.m21.clone(), self.m22.clone(), self.m23.clone()),
2 => Vec3::new(self.m31.clone(), self.m32.clone(), self.m33.clone()), 2 => Vec3::new(self.m31.clone(), self.m32.clone(), self.m33.clone()),
_ => fail!("Index out of range: 3d matrices do not have " + i.to_str() + " rows.") _ => fail!("Index out of range: 3d matrices do not have {} rows.", i.to_str())
} }
} }
@ -144,7 +144,7 @@ impl<N: Clone> Row<Vec3<N>> for Mat3<N> {
self.m32 = r.y.clone(); self.m32 = r.y.clone();
self.m33 = r.z; self.m33 = r.z;
}, },
_ => fail!("Index out of range: 3d matrices do not have " + i.to_str() + " rows.") _ => fail!("Index out of range: 3d matrices do not have {} rows.", i.to_str())
} }
} }
@ -162,7 +162,7 @@ impl<N: Clone> Col<Vec3<N>> for Mat3<N> {
0 => Vec3::new(self.m11.clone(), self.m21.clone(), self.m31.clone()), 0 => Vec3::new(self.m11.clone(), self.m21.clone(), self.m31.clone()),
1 => Vec3::new(self.m12.clone(), self.m22.clone(), self.m32.clone()), 1 => Vec3::new(self.m12.clone(), self.m22.clone(), self.m32.clone()),
2 => Vec3::new(self.m13.clone(), self.m23.clone(), self.m33.clone()), 2 => Vec3::new(self.m13.clone(), self.m23.clone(), self.m33.clone()),
_ => fail!("Index out of range: 3d matrices do not have " + i.to_str() + " cols.") _ => fail!("Index out of range: 3d matrices do not have {} cols.", i.to_str() )
} }
} }
@ -184,7 +184,7 @@ impl<N: Clone> Col<Vec3<N>> for Mat3<N> {
self.m23 = r.y.clone(); self.m23 = r.y.clone();
self.m33 = r.z; self.m33 = r.z;
}, },
_ => fail!("Index out of range: 3d matrices do not have " + i.to_str() + " cols.") _ => fail!("Index out of range: 3d matrices do not have {} cols.", i.to_str() )
} }
} }

View File

@ -53,7 +53,7 @@ impl<N: Clone> Row<Vec1<N>> for Vec2<N> {
match i { match i {
0 => Vec1::new(self.x.clone()), 0 => Vec1::new(self.x.clone()),
1 => Vec1::new(self.y.clone()), 1 => Vec1::new(self.y.clone()),
_ => fail!("Index out of range: 2d vectors do not have " + i.to_str() + " rows.") _ => fail!("Index out of range: 2d vectors do not have {} rows. ", i.to_str())
} }
} }
@ -62,7 +62,7 @@ impl<N: Clone> Row<Vec1<N>> for Vec2<N> {
match i { match i {
0 => self.x = r.x, 0 => self.x = r.x,
1 => self.y = r.x, 1 => self.y = r.x,
_ => fail!("Index out of range: 2d vectors do not have " + i.to_str() + " rows.") _ => fail!("Index out of range: 2d vectors do not have {} rows.", i.to_str())
} }
} }