Rename Array::swap_elems to Array::swap_elements

This commit is contained in:
Brendan Zabarauskas 2015-11-14 22:05:44 +11:00
parent dcb0afd57b
commit 5b2b10d65f
2 changed files with 10 additions and 10 deletions

View file

@ -40,7 +40,7 @@ pub trait Array where
/// Swap the elements at indices `i` and `j` in-place.
#[inline]
fn swap_elems(&mut self, i: usize, j: usize) {
fn swap_elements(&mut self, i: usize, j: usize) {
// Yeah, ok borrow checker I know what I'm doing here
unsafe { ptr::swap(&mut self[i], &mut self[j]) };
}

View file

@ -423,8 +423,8 @@ impl<S: BaseFloat> Matrix for Matrix2<S> {
#[inline]
fn swap_rows(&mut self, a: usize, b: usize) {
self[0].swap_elems(a, b);
self[1].swap_elems(a, b);
self[0].swap_elements(a, b);
self[1].swap_elements(a, b);
}
#[inline]
@ -570,9 +570,9 @@ impl<S: BaseFloat> Matrix for Matrix3<S> {
#[inline]
fn swap_rows(&mut self, a: usize, b: usize) {
self[0].swap_elems(a, b);
self[1].swap_elems(a, b);
self[2].swap_elems(a, b);
self[0].swap_elements(a, b);
self[1].swap_elements(a, b);
self[2].swap_elements(a, b);
}
#[inline]
@ -739,10 +739,10 @@ impl<S: BaseFloat> Matrix for Matrix4<S> {
#[inline]
fn swap_rows(&mut self, a: usize, b: usize) {
self[0].swap_elems(a, b);
self[1].swap_elems(a, b);
self[2].swap_elems(a, b);
self[3].swap_elems(a, b);
self[0].swap_elements(a, b);
self[1].swap_elements(a, b);
self[2].swap_elements(a, b);
self[3].swap_elements(a, b);
}
#[inline]