From 971afea727210f9745a82b27a56d0c7fac2725d8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 21 Feb 2025 10:55:36 +0100 Subject: [PATCH] Fix new clippy warnings --- src/core/tile_renderer.rs | 2 +- src/util.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/tile_renderer.rs b/src/core/tile_renderer.rs index a972b78..24af234 100644 --- a/src/core/tile_renderer.rs +++ b/src/core/tile_renderer.rs @@ -134,7 +134,7 @@ impl<'a> TileRenderer<'a> { /// Hashing the value as a single u32 is more efficient than hashing /// the tuple elements separately. fn biome_key((dx, dz, index): (i8, i8, u16)) -> u32 { - (dx as u8 as u32) | (dz as u8 as u32) << 8 | (index as u32) << 16 + (dx as u8 as u32) | ((dz as u8 as u32) << 8) | ((index as u32) << 16) } /// One quadrant of the kernel used to smooth biome edges diff --git a/src/util.rs b/src/util.rs index a128ef9..ed07ba5 100644 --- a/src/util.rs +++ b/src/util.rs @@ -39,7 +39,9 @@ pub fn to_flat_coord( chunk: ChunkCoord, block: BlockCoord, ) -> i32 { - (region as i32) << (BLOCK_BITS + CHUNK_BITS) | ((chunk.0 as i32) << BLOCK_BITS | block.0 as i32) + ((region as i32) << (BLOCK_BITS + CHUNK_BITS)) + | ((chunk.0 as i32) << BLOCK_BITS) + | (block.0 as i32) } /// Splits a flat (linear) coordinate into region, chunk and block numbers