Fix some clippy warnings

This commit is contained in:
crumblingstatue 2023-04-04 17:19:16 +02:00
parent c94beea85e
commit ff6dcca482
2 changed files with 2 additions and 9 deletions

View file

@ -30,7 +30,7 @@ pub struct ScreenPos {
pub type ScreenPosScalar = i16; pub type ScreenPosScalar = i16;
impl ScreenPos { impl ScreenPos {
pub fn to_sf_vec(&self) -> Vector2f { pub fn to_sf_vec(self) -> Vector2f {
Vector2f::new(self.x.into(), self.y.into()) Vector2f::new(self.x.into(), self.y.into())
} }
} }

View file

@ -9,19 +9,12 @@ pub struct ChunkPos {
y: ChunkPosScalar, y: ChunkPosScalar,
} }
#[derive(Default)]
pub struct World { pub struct World {
/// The currently loaded chunks /// The currently loaded chunks
chunks: FnvHashMap<ChunkPos, Chunk>, chunks: FnvHashMap<ChunkPos, Chunk>,
} }
impl Default for World {
fn default() -> Self {
Self {
chunks: Default::default(),
}
}
}
impl World { impl World {
/// Get mutable access to the tile at `pos`. /// Get mutable access to the tile at `pos`.
/// ///