From d3abbfcd4c95007120194a77848f97dbd5b72064 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Thu, 18 Sep 2014 12:47:28 +1000 Subject: [PATCH] Fix warnings --- src/structs/dmat.rs | 7 +++---- src/structs/mat_macros.rs | 3 +-- src/structs/spec/vec0.rs | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index f57caa78..749f1bf9 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -66,7 +66,7 @@ impl DMat { #[inline] pub fn reset(&mut self) { - for mij in self.mij.mut_iter() { + for mij in self.mij.iter_mut() { *mij = Zero::zero(); } } @@ -227,7 +227,7 @@ impl Indexable<(uint, uint), N> for DMat { unsafe fn unsafe_set(&mut self, rowcol: (uint, uint), val: N) { let (row, col) = rowcol; let offset = self.offset(row, col); - *self.mij.as_mut_slice().unsafe_mut_ref(offset) = val + *self.mij.as_mut_slice().unsafe_mut(offset) = val } /// Reads the value of a component of the matrix. @@ -358,7 +358,6 @@ Inv for DMat { let dim = self.nrows; let mut res: DMat = Eye::new_identity(dim); - let _0T: N = Zero::zero(); // inversion using Gauss-Jordan elimination for k in range(0u, dim) { @@ -369,7 +368,7 @@ Inv for DMat { let mut n0 = k; // index of a non-zero entry while n0 != dim { - if unsafe { self.unsafe_at((n0, k)) } != _0T { + if unsafe { self.unsafe_at((n0, k)) } != Zero::zero() { break; } diff --git a/src/structs/mat_macros.rs b/src/structs/mat_macros.rs index 6233d69e..fc487c82 100644 --- a/src/structs/mat_macros.rs +++ b/src/structs/mat_macros.rs @@ -430,7 +430,6 @@ macro_rules! inv_impl( fn inv(&mut self) -> bool { let mut res: $t = One::one(); - let _0N: N = Zero::zero(); // inversion using Gauss-Jordan elimination for k in range(0u, $dim) { @@ -441,7 +440,7 @@ macro_rules! inv_impl( let mut n0 = k; // index of a non-zero entry while n0 != $dim { - if self.at((n0, k)) != _0N { + if self.at((n0, k)) != Zero::zero() { break; } diff --git a/src/structs/spec/vec0.rs b/src/structs/spec/vec0.rs index b2734fae..e3fbcc32 100644 --- a/src/structs/spec/vec0.rs +++ b/src/structs/spec/vec0.rs @@ -46,7 +46,7 @@ impl Iterable for vec::Vec0 { impl IterableMut for vec::Vec0 { #[inline] fn mut_iter<'l>(&'l mut self) -> MutItems<'l, N> { - unsafe { mem::transmute::<&'l mut vec::Vec0, &'l mut [N, ..0]>(self).mut_iter() } + unsafe { mem::transmute::<&'l mut vec::Vec0, &'l mut [N, ..0]>(self).iter_mut() } } } @@ -74,7 +74,7 @@ impl Add> for vec::Vec0 { impl Sub> for vec::Vec0 { #[inline] - fn sub(&self, _: &T) -> vec::Vec0 { + fn sub(&self, _: &T) -> vec::Vec0 { vec::Vec0 } } @@ -95,7 +95,7 @@ impl Dot for vec::Vec0 { #[inline] fn sub_dot(_: &vec::Vec0, _: &vec::Vec0, _: &vec::Vec0) -> N { Zero::zero() - } + } } impl Mul> for vec::Vec0 {