Skip to content

Commit 6fd0a9d

Browse files
authored
Clean up clippy allows and unnecessary borrows (#1571)
1 parent 8adf5d8 commit 6fd0a9d

30 files changed

+66
-106
lines changed

benches/bench1.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#![feature(test)]
22
#![allow(unused_imports)]
3-
#![allow(
4-
clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::many_single_char_names
5-
)]
3+
#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal)]
64

75
extern crate test;
86

benches/construct.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![feature(test)]
2-
#![allow(
3-
clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::many_single_char_names
4-
)]
2+
#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal)]
53
extern crate test;
64
use test::Bencher;
75

benches/gemv_gemm.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![feature(test)]
2-
#![allow(
3-
clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::many_single_char_names
4-
)]
2+
#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal)]
53

64
extern crate test;
75
use test::Bencher;

benches/higher-order.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![feature(test)]
2-
#![allow(
3-
clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::many_single_char_names
4-
)]
2+
#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal)]
53
extern crate test;
64
use test::black_box;
75
use test::Bencher;

benches/iter.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![feature(test)]
2-
#![allow(
3-
clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::many_single_char_names
4-
)]
2+
#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal)]
53

64
extern crate test;
75
use rawpointer::PointerExt;
@@ -416,7 +414,7 @@ fn iter_axis_chunks_5_iter_sum(bench: &mut Bencher)
416414

417415
pub fn zip_mut_with(data: &Array3<f32>, out: &mut Array3<f32>)
418416
{
419-
out.zip_mut_with(&data, |o, &i| {
417+
out.zip_mut_with(data, |o, &i| {
420418
*o = i;
421419
});
422420
}

benches/par_rayon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn fastexp(x: f64) -> f64
5454
fn map_fastexp_regular(bench: &mut Bencher)
5555
{
5656
let mut a = Array2::<f64>::zeros((FASTEXP, FASTEXP));
57-
bench.iter(|| a.mapv_inplace(|x| fastexp(x)));
57+
bench.iter(|| a.mapv_inplace(fastexp));
5858
}
5959

6060
#[bench]
@@ -72,7 +72,7 @@ fn map_fastexp_cut(bench: &mut Bencher)
7272
{
7373
let mut a = Array2::<f64>::zeros((FASTEXP, FASTEXP));
7474
let mut a = a.slice_mut(s![.., ..-1]);
75-
bench.iter(|| a.mapv_inplace(|x| fastexp(x)));
75+
bench.iter(|| a.mapv_inplace(fastexp));
7676
}
7777

7878
#[bench]

examples/axis_ops.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![allow(
2-
clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::many_single_char_names
3-
)]
1+
#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal)]
42

53
use ndarray::prelude::*;
64

examples/bounds_check_elim.rs

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

64
// Test cases for bounds check elimination
75

@@ -57,7 +55,6 @@ pub fn test1d_single_mut(a: &mut Array1<f64>, i: usize) -> f64
5755
#[no_mangle]
5856
pub fn test1d_len_of(a: &Array1<f64>) -> f64
5957
{
60-
let a = a;
6158
let mut sum = 0.;
6259
for i in 0..a.len_of(Axis(0)) {
6360
sum += a[i];

examples/functions_and_traits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ fn takes_base<S: Data, D>(arr: &ArrayBase<S, D>)
7474

7575
// We can also pass it to functions that accept `RawRef` and `LayoutRef`
7676
// in the usual two ways:
77-
takes_rawref(&arr);
78-
takes_layout(&arr);
77+
takes_rawref(arr);
78+
takes_layout(arr);
7979
//
8080
takes_rawref_asref(&arr);
8181
takes_layout_asref(&arr);

examples/life.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![allow(
2-
clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::many_single_char_names
3-
)]
1+
#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal)]
42

53
use ndarray::prelude::*;
64

0 commit comments

Comments
 (0)