From ce0a6bcd02fac89544454e4efd3d1b9f60d12506 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Fri, 29 Mar 2013 09:10:55 +1100 Subject: [PATCH] Add 'self lifetimes --- src/mat.rs | 2 +- src/vec.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mat.rs b/src/mat.rs index 5a177c1..ed2c53d 100644 --- a/src/mat.rs +++ b/src/mat.rs @@ -239,7 +239,7 @@ pub trait Matrix4: Matrix { /** * A mutable matrix */ -pub trait MutableMatrix: Matrix { +pub trait MutableMatrix<'self,T,V>: Matrix { /** * # Return value * diff --git a/src/vec.rs b/src/vec.rs index 4a44bf9..e8eea56 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -31,7 +31,7 @@ pub trait Vector: Index + Eq { fn to_ptr(&self) -> *T; } -pub trait MutableVector: Vector { +pub trait MutableVector<'self, T>: Vector { /** * Get a mutable reference to the component at `i` */ @@ -179,8 +179,8 @@ pub trait NumericVector4: NumericVector { /** * A mutable vector with numeric components */ -pub trait MutableNumericVector: MutableVector<&'self T> + - NumericVector { +pub trait MutableNumericVector<'self, T>: MutableVector<&'self T> + + NumericVector { /** * Negate the vector */ @@ -220,7 +220,7 @@ pub trait MutableNumericVector: MutableVector<&'self T> + /** * A mutable 3-dimensional vector with numeric components */ -pub trait MutableNumericVector3: MutableNumericVector<&'self T> { +pub trait MutableNumericVector3<'self, T>: MutableNumericVector<&'self T> { /** * Set to the cross product of the vector and `other` */ @@ -313,8 +313,8 @@ pub trait EuclideanVector: NumericVector { * * * `T` - The type of the components. This should be a floating point type. */ -pub trait MutableEuclideanVector: MutableNumericVector<&'self T> + - EuclideanVector { +pub trait MutableEuclideanVector<'self, T>: MutableNumericVector<&'self T> + + EuclideanVector { /** * Normalize the vector */