Merge branch 'xMAC94x/clippy_cleanup' into 'master'

fix leftovers from toolchain update

See merge request veloren/veloren!3713
This commit is contained in:
Marcel 2022-11-30 14:31:28 +00:00
commit a813b80850
3 changed files with 4 additions and 5 deletions

View File

@ -1003,8 +1003,7 @@ impl Client {
}
pub fn set_lod_distance(&mut self, lod_distance: u32) {
#[allow(clippy::manual_clamp)]
let lod_distance = lod_distance.max(0).min(1000) as f32 / lod::ZONE_SIZE as f32;
let lod_distance = lod_distance.clamp(0, 1000) as f32 / lod::ZONE_SIZE as f32;
self.lod_distance = lod_distance;
}

View File

@ -71,7 +71,7 @@ impl<V, S: VolSize, M> Chunk<V, S, M> {
Self::GROUP_VOLUME / (Self::GROUP_LONG_SIDE_LEN * Self::GROUP_LONG_SIDE_LEN),
);
const GROUP_VOLUME: u32 = [Self::VOLUME / 256, 1][(Self::VOLUME < 256) as usize];
const VOLUME: u32 = (S::SIZE.x * S::SIZE.y * S::SIZE.z);
const VOLUME: u32 = S::SIZE.x * S::SIZE.y * S::SIZE.z;
/// Creates a new `Chunk` with the provided dimensions and all voxels filled
/// with duplicates of the provided voxel.

View File

@ -263,7 +263,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
) {
let water_chunk = posj.map(|e| e as f64);
let lake_width_noise =
sim.gen_ctx.small_nz.get((wposf.div(32.0)).into_array());
sim.gen_ctx.small_nz.get(wposf.div(32.0).into_array());
let water_aabr = Aabr {
min: water_chunk * neighbor_coef + 4.0 - lake_width_noise * 8.0,
max: (water_chunk + 1.0) * neighbor_coef - 4.0
@ -312,7 +312,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
RiverKind::Ocean => {
let water_chunk = posj.map(|e| e as f64);
let lake_width_noise =
sim.gen_ctx.small_nz.get((wposf.div(32.0)).into_array());
sim.gen_ctx.small_nz.get(wposf.div(32.0).into_array());
let water_aabr = Aabr {
min: water_chunk * neighbor_coef + 4.0 - lake_width_noise * 8.0,
max: (water_chunk + 1.0) * neighbor_coef - 4.0 + lake_width_noise * 8.0,