Skip to content

Commit 48d8bef

Browse files
committed
Add type annotation required by rustc 2015-03-31
Resolves this error, which is fallout from rust-lang/rust#23673: src/structs/dmat.rs:501:43: 501:74 error: type annotations required: cannot resolve `<f64 as core::ops::Div<_>>::Output == f64` [E0284] src/structs/dmat.rs:501 let normalizer: N = Cast::from(1.0f64 / Cast::from(self.nrows)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 1fc59cb commit 48d8bef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/structs/dmat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ impl<N: Clone + Copy> Transpose for DMat<N> {
498498
impl<N: BaseNum + Cast<f64> + Clone> Mean<DVec<N>> for DMat<N> {
499499
fn mean(&self) -> DVec<N> {
500500
let mut res: DVec<N> = DVec::new_zeros(self.ncols);
501-
let normalizer: N = Cast::from(1.0f64 / Cast::from(self.nrows));
501+
let nrows_f64: f64 = Cast::from(self.nrows);
502+
let normalizer: N = Cast::from(1.0f64 / nrows_f64);
502503

503504
for i in 0..self.nrows {
504505
for j in 0..self.ncols {

0 commit comments

Comments
 (0)