Finish up clippy lint.

This commit is contained in:
2019-02-26 19:00:58 -08:00
parent e64e6af085
commit 0ec6f46be0
7 changed files with 29 additions and 23 deletions

View File

@@ -17,7 +17,7 @@ impl Lode {
{
let mut noise = vec![vec![vec![0.; NOISE_SIZE]; NOISE_SIZE]; NOISE_SIZE];
// Squelch warning about only being used to index, as this way reads more consistently.
#[cfg_attr(feature = "cargo-clippy", allow(needless_range_loop))]
#[allow(clippy::needless_range_loop)]
for x in 0..NOISE_SIZE {
for y in 0..NOISE_SIZE {
for z in 0..NOISE_SIZE {

View File

@@ -1,5 +1,5 @@
// There are many math functions in this file, so we allow single letter variable names.
#![cfg_attr(feature = "cargo-clippy", allow(many_single_char_names))]
#![allow(clippy::many_single_char_names)]
use rand::Rng;
use crate::noise::NoiseSource;
@@ -23,8 +23,10 @@ where
rng.gen_range::<f32>(-1., 1.),
rng.gen_range::<f32>(-1., 1.),
rng.gen_range::<f32>(-1., 1.),
).unit_vector()
}).collect()
)
.unit_vector()
})
.collect()
}
fn perlin_generate_perm<R>(rng: &mut R) -> Vec<usize>
@@ -134,13 +136,13 @@ impl NoiseSource for Perlin {
let mut c: [[[Vec3; 2]; 2]; 2] = Default::default();
// Squelch warning about di only being used to index, as this way reads more consistently.
#[cfg_attr(feature = "cargo-clippy", allow(needless_range_loop))]
#[allow(clippy::needless_range_loop)]
for di in 0..2 {
for dj in 0..2 {
for dk in 0..2 {
c[di][dj][dk] = self.ran_vec[self.perm_x[(i + di) & 255]
^ self.perm_y[(j + dj) & 255]
^ self.perm_z[(k + dk) & 255]]
^ self.perm_y[(j + dj) & 255]
^ self.perm_z[(k + dk) & 255]]
}
}
}