Skip to content

Commit f0173a8

Browse files
committed
even more
1 parent 0ed84b5 commit f0173a8

22 files changed

+73
-44
lines changed

benches/bench1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ fn iadd_scalar_2d_strided_dyn(bench: &mut test::Bencher) {
589589
fn scaled_add_2d_f32_regular(bench: &mut test::Bencher) {
590590
let mut av = Array::<f32, _>::zeros((ADD2DSZ, ADD2DSZ));
591591
let bv = Array::<f32, _>::zeros((ADD2DSZ, ADD2DSZ));
592-
let scalar = std::f32::consts::Pi;
592+
let scalar = std::f32::consts::PI;
593593
bench.iter(|| {
594594
av.scaled_add(scalar, &bv);
595595
});

examples/axis_ops.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#![allow(
2+
clippy::many_single_char_names,
3+
clippy::deref_addrof,
4+
clippy::unreadable_literal,
5+
clippy::many_single_char_names
6+
)]
17
extern crate ndarray;
28

39
use ndarray::prelude::*;

examples/bounds_check_elim.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#![crate_type = "lib"]
2+
#![allow(
3+
clippy::many_single_char_names,
4+
clippy::deref_addrof,
5+
clippy::unreadable_literal,
6+
clippy::many_single_char_names
7+
)]
28

39
// Test cases for bounds check elimination
410

examples/convo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ where
2828
for i in 0..n - 2 {
2929
for j in 0..m - 2 {
3030
let mut conv = F::zero();
31+
#[allow(clippy::needless_range_loop)]
3132
for k in 0..3 {
3233
for l in 0..3 {
3334
conv = conv + *a.uget((i + k, j + l)) * kernel[k][l];

examples/life.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern crate ndarray;
88

99
use ndarray::prelude::*;
1010

11-
const INPUT: &'static [u8] = include_bytes!("life.txt");
11+
const INPUT: &[u8] = include_bytes!("life.txt");
1212
//const INPUT: &'static [u8] = include_bytes!("lifelite.txt");
1313

1414
const N: usize = 100;
@@ -77,7 +77,7 @@ fn render(a: &Board) {
7777
print!(".");
7878
}
7979
}
80-
println!("");
80+
println!();
8181
}
8282
}
8383

examples/zip_many.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
#![allow(
2+
clippy::many_single_char_names,
3+
clippy::deref_addrof,
4+
clippy::unreadable_literal,
5+
clippy::many_single_char_names
6+
)]
17
extern crate ndarray;
28

9+
310
use ndarray::prelude::*;
411
use ndarray::Zip;
512

src/dimension/dimension_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ macro_rules! impl_insert_axis_array(
367367
debug_assert!(axis.index() <= $n);
368368
let mut out = [1; $n + 1];
369369
out[0..axis.index()].copy_from_slice(&self.slice()[0..axis.index()]);
370-
out[axis.index()+1..$n+1].copy_from_slice(&self.slice()[axis.index()..$n]);
370+
out[axis.index()+1..=$n].copy_from_slice(&self.slice()[axis.index()..$n]);
371371
Dim(out)
372372
}
373373
);

src/dimension/dynindeximpl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl IxDyn {
221221
/// Create a new dimension value with `n` axes, all zeros
222222
#[inline]
223223
pub fn zeros(n: usize) -> IxDyn {
224-
const ZEROS: &'static [usize] = &[0; 4];
224+
const ZEROS: &[usize] = &[0; 4];
225225
if n <= ZEROS.len() {
226226
Dim(&ZEROS[..n])
227227
} else {

src/geomspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ where
9696
Some(Geomspace {
9797
sign: a.signum(),
9898
start: log_a,
99-
step: step,
99+
step,
100100
index: 0,
101101
len: n,
102102
})

src/impl_clone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ impl<S: RawDataClone, D: Clone> Clone for ArrayBase<S, D> {
1313
unsafe {
1414
let (data, ptr) = self.data.clone_with_ptr(self.ptr);
1515
ArrayBase {
16-
data: data,
17-
ptr: ptr,
16+
data,
17+
ptr,
1818
dim: self.dim.clone(),
1919
strides: self.strides.clone(),
2020
}

0 commit comments

Comments
 (0)