From ff6dcca482c7373c609c2ea33a916b746179bf74 Mon Sep 17 00:00:00 2001 From: crumblingstatue Date: Tue, 4 Apr 2023 17:19:16 +0200 Subject: [PATCH] Fix some clippy warnings --- src/graphics.rs | 2 +- src/world.rs | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/graphics.rs b/src/graphics.rs index 8710146..897a056 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -30,7 +30,7 @@ pub struct ScreenPos { pub type ScreenPosScalar = i16; impl ScreenPos { - pub fn to_sf_vec(&self) -> Vector2f { + pub fn to_sf_vec(self) -> Vector2f { Vector2f::new(self.x.into(), self.y.into()) } } diff --git a/src/world.rs b/src/world.rs index bae3420..6c85b93 100644 --- a/src/world.rs +++ b/src/world.rs @@ -9,19 +9,12 @@ pub struct ChunkPos { y: ChunkPosScalar, } +#[derive(Default)] pub struct World { /// The currently loaded chunks chunks: FnvHashMap, } -impl Default for World { - fn default() -> Self { - Self { - chunks: Default::default(), - } - } -} - impl World { /// Get mutable access to the tile at `pos`. ///