Merge pull request #97 from HeroesGrave/master

Remove lifetime notations causing errors
This commit is contained in:
Brendan Zabarauskas 2014-07-04 22:40:43 -07:00
commit 356ec1b2be
6 changed files with 16 additions and 16 deletions

View file

@ -58,14 +58,14 @@ trait ScalarConv<S> {
impl<S: BaseFloat> ScalarConv<S> for Rad<S> { impl<S: BaseFloat> ScalarConv<S> for Rad<S> {
#[inline] fn from(s: S) -> Rad<S> { rad(s) } #[inline] fn from(s: S) -> Rad<S> { rad(s) }
#[inline] fn s<'a>(&'a self) -> &'a S { &'a self.s } #[inline] fn s<'a>(&'a self) -> &'a S { &self.s }
#[inline] fn mut_s<'a>(&'a mut self) -> &'a mut S { &'a mut self.s } #[inline] fn mut_s<'a>(&'a mut self) -> &'a mut S { &mut self.s }
} }
impl<S: BaseFloat> ScalarConv<S> for Deg<S> { impl<S: BaseFloat> ScalarConv<S> for Deg<S> {
#[inline] fn from(s: S) -> Deg<S> { deg(s) } #[inline] fn from(s: S) -> Deg<S> { deg(s) }
#[inline] fn s<'a>(&'a self) -> &'a S { &'a self.s } #[inline] fn s<'a>(&'a self) -> &'a S { &self.s }
#[inline] fn mut_s<'a>(&'a mut self) -> &'a mut S { &'a mut self.s } #[inline] fn mut_s<'a>(&'a mut self) -> &'a mut S { &mut self.s }
} }
/// Operations on angles. /// Operations on angles.

View file

@ -396,13 +396,13 @@ impl<S: Copy> Array2<Vector2<S>, Vector2<S>, S> for Matrix2<S> {
#[inline] #[inline]
fn c<'a>(&'a self, c: uint) -> &'a Vector2<S> { fn c<'a>(&'a self, c: uint) -> &'a Vector2<S> {
let slice: &'a [Vector2<S>, ..2] = unsafe { mem::transmute(self) }; let slice: &'a [Vector2<S>, ..2] = unsafe { mem::transmute(self) };
&'a slice[c] &slice[c]
} }
#[inline] #[inline]
fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Vector2<S> { fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Vector2<S> {
let slice: &'a mut [Vector2<S>, ..2] = unsafe { mem::transmute(self) }; let slice: &'a mut [Vector2<S>, ..2] = unsafe { mem::transmute(self) };
&'a mut slice[c] &mut slice[c]
} }
#[inline] #[inline]
@ -428,13 +428,13 @@ impl<S: Copy> Array2<Vector3<S>, Vector3<S>, S> for Matrix3<S> {
#[inline] #[inline]
fn c<'a>(&'a self, c: uint) -> &'a Vector3<S> { fn c<'a>(&'a self, c: uint) -> &'a Vector3<S> {
let slice: &'a [Vector3<S>, ..3] = unsafe { mem::transmute(self) }; let slice: &'a [Vector3<S>, ..3] = unsafe { mem::transmute(self) };
&'a slice[c] &slice[c]
} }
#[inline] #[inline]
fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Vector3<S> { fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Vector3<S> {
let slice: &'a mut [Vector3<S>, ..3] = unsafe { mem::transmute(self) }; let slice: &'a mut [Vector3<S>, ..3] = unsafe { mem::transmute(self) };
&'a mut slice[c] &mut slice[c]
} }
#[inline] #[inline]
@ -462,13 +462,13 @@ impl<S: Copy> Array2<Vector4<S>, Vector4<S>, S> for Matrix4<S> {
#[inline] #[inline]
fn c<'a>(&'a self, c: uint) -> &'a Vector4<S> { fn c<'a>(&'a self, c: uint) -> &'a Vector4<S> {
let slice: &'a [Vector4<S>, ..4] = unsafe { mem::transmute(self) }; let slice: &'a [Vector4<S>, ..4] = unsafe { mem::transmute(self) };
&'a slice[c] &slice[c]
} }
#[inline] #[inline]
fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Vector4<S> { fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Vector4<S> {
let slice: &'a mut [Vector4<S>, ..4] = unsafe { mem::transmute(self) }; let slice: &'a mut [Vector4<S>, ..4] = unsafe { mem::transmute(self) };
&'a mut slice[c] &mut slice[c]
} }
#[inline] #[inline]

View file

@ -118,7 +118,7 @@ impl<S: BaseNum> Array1<S> for Point2<S> {
#[inline] #[inline]
fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S { fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S {
let slice: &'a mut [S, ..2] = unsafe { mem::transmute(self) }; let slice: &'a mut [S, ..2] = unsafe { mem::transmute(self) };
&'a mut slice[i] &mut slice[i]
} }
} }
@ -236,7 +236,7 @@ impl<S: BaseNum> Array1<S> for Point3<S> {
#[inline] #[inline]
fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S { fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S {
let slice: &'a mut [S, ..3] = unsafe { mem::transmute(self) }; let slice: &'a mut [S, ..3] = unsafe { mem::transmute(self) };
&'a mut slice[i] &mut slice[i]
} }
} }

View file

@ -53,7 +53,7 @@ impl<S: Copy> Array1<S> for Quaternion<S> {
#[inline] #[inline]
fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S { fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S {
let slice: &'a mut [S, ..4] = unsafe { mem::transmute(self) }; let slice: &'a mut [S, ..4] = unsafe { mem::transmute(self) };
&'a mut slice[i] &mut slice[i]
} }
} }

View file

@ -133,7 +133,7 @@ pub struct Basis2<S> {
impl<S: BaseFloat> Basis2<S> { impl<S: BaseFloat> Basis2<S> {
/// Coerce to a `Matrix2` /// Coerce to a `Matrix2`
#[inline] #[inline]
pub fn as_matrix2<'a>(&'a self) -> &'a Matrix2<S> { &'a self.mat } pub fn as_matrix2<'a>(&'a self) -> &'a Matrix2<S> { &self.mat }
} }
/// Represents types which can be converted to a rotation matrix. /// Represents types which can be converted to a rotation matrix.
@ -217,7 +217,7 @@ impl<S: BaseFloat> Basis3<S> {
/// Coerce to a `Matrix3` /// Coerce to a `Matrix3`
#[inline] #[inline]
pub fn as_matrix3<'a>(&'a self) -> &'a Matrix3<S> { &'a self.mat } pub fn as_matrix3<'a>(&'a self) -> &'a Matrix3<S> { &self.mat }
} }
/// Represents types which can be converted to a rotation matrix. /// Represents types which can be converted to a rotation matrix.

View file

@ -142,7 +142,7 @@ macro_rules! vec(
#[inline] #[inline]
fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S { fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut S {
let slice: &'a mut [S, ..$n] = unsafe { mem::transmute(self) }; let slice: &'a mut [S, ..$n] = unsafe { mem::transmute(self) };
&'a mut slice[i] &mut slice[i]
} }
} }