Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ Basic operations on arrays are all element-wise; you need to use specific method
```rust
use ndarray::prelude::*;
use ndarray::Array;
use std::f64::INFINITY as inf;

fn main() {
let a = array![
Expand All @@ -119,7 +118,7 @@ fn main() {
assert_eq!(&a + &b, array![[10., 21., 32., 43.,]]); // Allocates a new array. Note the explicit `&`.
assert_eq!(&a - &b, array![[10., 19., 28., 37.,]]);
assert_eq!(&a * &b, array![[0., 20., 60., 120.,]]);
assert_eq!(&a / &b, array![[inf, 20., 15., 13.333333333333334,]]);
assert_eq!(&a / &b, array![[f64::INFINITY, 20., 15., 13.333333333333334,]]);
}
```

Expand Down
5 changes: 1 addition & 4 deletions src/indexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ where D: Dimension
#[inline]
fn next(&mut self) -> Option<Self::Item>
{
let index = match self.index {
None => return None,
Some(ref ix) => ix.clone(),
};
let index = self.index.clone()?;
self.index = self.dim.next_for(index.clone());
Some(index.into_pattern())
}
Expand Down
10 changes: 2 additions & 8 deletions src/iterators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,7 @@ impl<'a, A, D: Dimension> Iterator for IndexedIter<'a, A, D>
#[inline]
fn next(&mut self) -> Option<Self::Item>
{
let index = match self.0.inner.index {
None => return None,
Some(ref ix) => ix.clone(),
};
let index = self.0.inner.index.clone()?;
match self.0.next() {
None => None,
Some(elem) => Some((index.into_pattern(), elem)),
Expand Down Expand Up @@ -695,10 +692,7 @@ impl<'a, A, D: Dimension> Iterator for IndexedIterMut<'a, A, D>
#[inline]
fn next(&mut self) -> Option<Self::Item>
{
let index = match self.0.inner.index {
None => return None,
Some(ref ix) => ix.clone(),
};
let index = self.0.inner.index.clone()?;
match self.0.next() {
None => None,
Some(elem) => Some((index.into_pattern(), elem)),
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
clippy::deref_addrof,
clippy::manual_map, // is not an error
clippy::while_let_on_iterator, // is not an error
clippy::from_iter_instead_of_collect, // using from_iter is good style
clippy::incompatible_msrv, // false positive PointerExt::offset
)]
#![doc(test(attr(deny(warnings))))]
Expand Down
1 change: 0 additions & 1 deletion tests/numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use approx::assert_abs_diff_eq;
use ndarray::{arr0, arr1, arr2, array, aview1, Array, Array1, Array2, Array3, Axis};
use std::f64;

#[test]
fn test_mean_with_nan_values()
Expand Down
Loading