Skip to content

Commit acd3aef

Browse files
committed
Fix clippy issues
1 parent ed91681 commit acd3aef

File tree

35 files changed

+152
-193
lines changed

35 files changed

+152
-193
lines changed

ci/all.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set -ex
66

7-
: ${1?"The all.sh script requires one argument."}
7+
: "${1?The all.sh script requires one argument.}"
88

99
op=$1
1010

@@ -54,11 +54,18 @@ $CMD
5454
for dir in examples/*/
5555
do
5656
dir=${dir%*/}
57-
cd ${dir%*/}
58-
$CMD
59-
cd -
57+
(
58+
cd "${dir%*/}"
59+
$CMD
60+
)
6061
done
6162

62-
cd verify/verify
63-
$CMD
64-
cd -
63+
(
64+
cd verify/verify
65+
$CMD
66+
)
67+
68+
(
69+
cd micro_benchmarks
70+
$CMD
71+
)

examples/aobench/benches/isec_plane.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
use criterion::*;
55

6-
use aobench_lib::*;
76
use crate::geometry::{f32xN, Plane, Ray, RayxN, V3DxN, V3D};
87
use crate::intersection::{Intersect, Isect, IsectxN};
8+
use aobench_lib::*;
99

1010
fn hit_scalar(c: &mut Criterion) {
1111
let mut s = Plane {

examples/aobench/benches/isec_sphere.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Benchmarks intersection between rays and spheres
22
#![feature(stdsimd)]
33

4-
use aobench_lib::*;
54
use crate::geometry::{f32xN, Ray, RayxN, Sphere, V3DxN, V3D};
65
use crate::intersection::{Intersect, Isect, IsectxN};
6+
use aobench_lib::*;
77
use criterion::*;
88
use test::*;
99

examples/aobench/src/lib.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
//! Fujita.
55
#![deny(warnings, rust_2018_idioms)]
66
#![allow(non_snake_case, non_camel_case_types)]
7-
#![cfg_attr(
8-
feature = "cargo-clippy",
9-
allow(
10-
clippy::many_single_char_names,
11-
clippy::similar_names,
12-
clippy::cast_precision_loss,
13-
clippy::inline_always,
14-
clippy::cast_possible_truncation,
15-
clippy::cast_sign_loss,
16-
clippy::identity_op,
17-
clippy::erasing_op
18-
)
7+
#![allow(
8+
clippy::many_single_char_names,
9+
clippy::similar_names,
10+
clippy::cast_precision_loss,
11+
clippy::inline_always,
12+
clippy::cast_possible_truncation,
13+
clippy::cast_sign_loss,
14+
clippy::identity_op,
15+
clippy::erasing_op
1916
)]
2017

2118
pub mod ambient_occlusion;

examples/aobench/src/tiled.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! SIMD serial aobench
22
3-
use cfg_if::cfg_if;
43
use crate::ambient_occlusion;
54
use crate::geometry::{f32xN, pf32xN, usizexN, IncrV, RayxN, V3DxN};
65
use crate::intersection::{Intersect, IsectxN};
76
use crate::scene::Scene;
7+
use cfg_if::cfg_if;
88

99
#[inline(always)]
1010
fn ao_impl<S: Scene>(

examples/aobench/src/vector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! SIMD serial aobench
22
3-
use cfg_if::cfg_if;
43
use crate::ambient_occlusion;
54
use crate::geometry::{Ray, V3D};
65
use crate::intersection::{Intersect, Isect};
76
use crate::scene::Scene;
7+
use cfg_if::cfg_if;
88

99
#[inline(always)]
1010
fn ao_impl<S: Scene>(

examples/fannkuch_redux/src/lib.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
//! Fannkuch redux
22
#![deny(warnings, rust_2018_idioms)]
33
#![allow(non_snake_case, non_camel_case_types)]
4-
#![cfg_attr(
5-
feature = "cargo-clippy",
6-
allow(
7-
clippy::similar_names,
8-
clippy::many_single_char_names,
9-
clippy::cast_possible_truncation,
10-
clippy::cast_sign_loss,
11-
clippy::cast_possible_wrap
12-
)
4+
#![allow(
5+
clippy::similar_names,
6+
clippy::many_single_char_names,
7+
clippy::cast_possible_truncation,
8+
clippy::cast_sign_loss,
9+
clippy::cast_possible_wrap
1310
)]
1411

1512
pub mod scalar;

examples/mandelbrot/src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
//! [bg]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/mandelbrot.html#mandelbrot
44
55
#![deny(warnings, rust_2018_idioms)]
6-
#![cfg_attr(
7-
feature = "cargo-clippy",
8-
allow(
9-
clippy::cast_precision_loss,
10-
clippy::cast_sign_loss,
11-
clippy::cast_possible_truncation
12-
)
6+
#![allow(
7+
clippy::cast_precision_loss,
8+
clippy::cast_sign_loss,
9+
clippy::cast_possible_truncation
1310
)]
1411

1512
use rayon::prelude::*;

examples/matrix_inverse/src/scalar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![rustfmt::skip]
33
use crate::*;
44

5-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::too_many_lines))]
5+
#[allow(clippy::too_many_lines)]
66
pub fn inv4x4(m: Matrix4x4) -> Option<Matrix4x4> {
77
let m = m.0;
88

examples/nbody/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
//!
33
//! [bg]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/nbody.html#nbody
44
#![deny(warnings, rust_2018_idioms)]
5-
#![cfg_attr(
6-
feature = "cargo-clippy",
7-
allow(clippy::similar_names, clippy::excessive_precision)
8-
)]
5+
#![allow(clippy::similar_names, clippy::excessive_precision)]
96

107
pub mod scalar;
118
pub mod simd;

0 commit comments

Comments
 (0)