From 1cb33140642df2b5fd749b3ad14ed97bbd329e16 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 31 Mar 2015 16:38:24 -0400 Subject: [PATCH] Add type annotation required by rustc 2015-03-31 Resolves this error, which is fallout from https://github.com/rust-lang/rust/pull/23673: src/structs/dmat.rs:501:43: 501:74 error: type annotations required: cannot resolve `>::Output == f64` [E0284] src/structs/dmat.rs:501 let normalizer: N = Cast::from(1.0f64 / Cast::from(self.nrows)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Anders Kaseorg --- src/lib.rs | 4 ++-- src/structs/dmat.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1b269153..5f8715c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -541,7 +541,7 @@ pub fn prepend_rotation>(m: &M, v: &V) -> M { /// use na::{BaseFloat, Rot3, Vec3}; /// /// fn main() { -/// let t = Rot3::new(Vec3::new(0.0f64, 0.0, 0.5 * BaseFloat::pi())); +/// let t = Rot3::new(Vec3::new(0.0f64, 0.0, 0.5 * ::pi())); /// let v = Vec3::new(1.0, 0.0, 0.0); /// /// let tv = na::rotate(&t, &v); @@ -562,7 +562,7 @@ pub fn rotate>(m: &M, v: &V) -> V { /// use na::{BaseFloat, Rot3, Vec3}; /// /// fn main() { -/// let t = Rot3::new(Vec3::new(0.0f64, 0.0, 0.5 * BaseFloat::pi())); +/// let t = Rot3::new(Vec3::new(0.0f64, 0.0, 0.5 * ::pi())); /// let v = Vec3::new(1.0, 0.0, 0.0); /// /// let tv = na::inv_rotate(&t, &v); diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index c7c2481a..48c7ebff 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -498,7 +498,7 @@ impl Transpose for DMat { impl + Clone> Mean> for DMat { fn mean(&self) -> DVec { let mut res: DVec = DVec::new_zeros(self.ncols); - let normalizer: N = Cast::from(1.0f64 / Cast::from(self.nrows)); + let normalizer: N = Cast::from(1.0f64 / self.nrows as f64); for i in 0..self.nrows { for j in 0..self.ncols {