From 5ed33b785f88d39f8d44ccc247b55a7d91cf909d Mon Sep 17 00:00:00 2001 From: crumblingstatue Date: Sat, 15 Apr 2023 19:27:07 +0200 Subject: [PATCH] Fix clippy lints --- src/math.rs | 2 +- src/world.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/math.rs b/src/math.rs index 622e55b..c91dd79 100644 --- a/src/math.rs +++ b/src/math.rs @@ -92,7 +92,7 @@ pub struct IntRect { pub h: i32, } impl IntRect { - pub(crate) fn to_sf(&self) -> sfml::graphics::Rect { + pub(crate) fn to_sf(self) -> sfml::graphics::Rect { sfml::graphics::Rect:: { left: self.x, top: self.y, diff --git a/src/world.rs b/src/world.rs index f7546c7..8f4477b 100644 --- a/src/world.rs +++ b/src/world.rs @@ -238,7 +238,7 @@ impl Chunk { pub fn load_or_gen(chk: ChunkPos, worldgen: &Worldgen, world_path: &Path) -> Chunk { log::info!("Loading chunk {chk:?} (reg: {:?})", chk.region()); let reg_filename = world_path.join(format_reg_file_name(chk.region())); - let chunk = if chunk_exists(®_filename, chk) { + if chunk_exists(®_filename, chk) { log::info!("Chunk exists, loading"); let mut f = File::open(®_filename).unwrap(); let bitset = ExistenceBitset::read_from_file(&mut f); @@ -251,8 +251,7 @@ impl Chunk { } else { log::warn!("Chunk at {:?} doesn't exist, generating.", chk); Chunk::gen(chk, worldgen) - }; - chunk + } } fn at_mut(&mut self, local: ChunkLocalTilePos) -> &mut Tile {