Remove deprecated functions from array traits

This commit is contained in:
Brendan Zabarauskas 2014-08-11 16:54:39 +10:00
parent 9aec9fb279
commit 8999d88216
2 changed files with 4 additions and 46 deletions

View file

@ -28,20 +28,6 @@ pub trait Array1<Element: Copy>: Index<uint, Element> + IndexMut<uint, Element>
&mut (*self)[0]
}
/// Get a shared reference to the `i`th value.
#[deprecated = "Use index operator instead"]
#[inline]
fn i<'a>(&'a self, i: uint) -> &'a Element {
&(*self)[i]
}
/// Get a mutable reference to the `i`th value.
#[deprecated = "Use index operator instead"]
#[inline]
fn mut_i<'a>(&'a mut self, i: uint) -> &'a mut Element {
&mut (*self)[i]
}
#[inline]
/// Swap the elements at indices `i` and `j` in-place.
fn swap_i(&mut self, i: uint, j: uint) {
@ -72,20 +58,6 @@ pub trait Array2<Column: Array1<Element>, Row: Array1<Element>, Element: Copy>:
&mut (*self)[0][0]
}
/// Get a shared reference to a column of this array.
#[deprecated = "Use index operator instead"]
#[inline]
fn c<'a>(&'a self, c: uint) -> &'a Column {
&(*self)[c]
}
/// Get a mutable reference to a column of this array.
#[deprecated = "Use index operator instead"]
#[inline]
fn mut_c<'a>(&'a mut self, c: uint) -> &'a mut Column {
&mut (*self)[c]
}
/// Swap two columns of this array.
#[inline]
fn swap_c(&mut self, a: uint, b: uint) {
@ -104,20 +76,6 @@ pub trait Array2<Column: Array1<Element>, Row: Array1<Element>, Element: Copy>:
/// Swap two rows of this array.
fn swap_r(&mut self, a: uint, b: uint);
/// Return a shared reference to the element at column `c` and row `r`.
#[deprecated = "Use index operators instead"]
#[inline]
fn cr<'a>(&'a self, c: uint, r: uint) -> &'a Element {
&(*self)[c][r]
}
/// Return a mutable reference to the element at column `c` and row `r`.
#[deprecated = "Use index operators instead"]
#[inline]
fn mut_cr<'a>(&'a mut self, c: uint, r: uint) -> &'a mut Element {
&mut (*self)[c][r]
}
/// Swap the values at index `a` and `b`
#[inline]
fn swap_cr(&mut self, a: (uint, uint), b: (uint, uint)) {

View file

@ -209,7 +209,7 @@ Matrix3<S> {
_1subc * axis.z * axis.z + c)
}
/// Create a matrix from a non-uniform scale
/// Create a matrix from a non-uniform scale
pub fn from_diagonal(value: &Vector3<S>) -> Matrix3<S> {
Matrix3::new(value.x, zero(), zero(),
zero(), value.y, zero(),
@ -377,9 +377,9 @@ impl<S: BaseFloat> Sub<Matrix2<S>, Matrix2<S>> for Matrix2<S> { #[inline] fn sub
impl<S: BaseFloat> Sub<Matrix3<S>, Matrix3<S>> for Matrix3<S> { #[inline] fn sub(&self, other: &Matrix3<S>) -> Matrix3<S> { self.sub_m(other) } }
impl<S: BaseFloat> Sub<Matrix4<S>, Matrix4<S>> for Matrix4<S> { #[inline] fn sub(&self, other: &Matrix4<S>) -> Matrix4<S> { self.sub_m(other) } }
impl<S: BaseFloat> Neg<Matrix2<S>> for Matrix2<S> { #[inline] fn neg(&self) -> Matrix2<S> { Matrix2::from_cols(self.c(0).neg(), self.c(1).neg()) } }
impl<S: BaseFloat> Neg<Matrix3<S>> for Matrix3<S> { #[inline] fn neg(&self) -> Matrix3<S> { Matrix3::from_cols(self.c(0).neg(), self.c(1).neg(), self.c(2).neg()) } }
impl<S: BaseFloat> Neg<Matrix4<S>> for Matrix4<S> { #[inline] fn neg(&self) -> Matrix4<S> { Matrix4::from_cols(self.c(0).neg(), self.c(1).neg(), self.c(2).neg(), self.c(3).neg()) } }
impl<S: BaseFloat> Neg<Matrix2<S>> for Matrix2<S> { #[inline] fn neg(&self) -> Matrix2<S> { Matrix2::from_cols(self[0].neg(), self[1].neg()) } }
impl<S: BaseFloat> Neg<Matrix3<S>> for Matrix3<S> { #[inline] fn neg(&self) -> Matrix3<S> { Matrix3::from_cols(self[0].neg(), self[1].neg(), self[2].neg()) } }
impl<S: BaseFloat> Neg<Matrix4<S>> for Matrix4<S> { #[inline] fn neg(&self) -> Matrix4<S> { Matrix4::from_cols(self[0].neg(), self[1].neg(), self[2].neg(), self[3].neg()) } }
impl<S: BaseFloat> Zero for Matrix2<S> { #[inline] fn zero() -> Matrix2<S> { Matrix2::zero() } #[inline] fn is_zero(&self) -> bool { *self == zero() } }
impl<S: BaseFloat> Zero for Matrix3<S> { #[inline] fn zero() -> Matrix3<S> { Matrix3::zero() } #[inline] fn is_zero(&self) -> bool { *self == zero() } }