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`. ///