From 6cdeb38ba44e30b2f1dd33f9dc16a0fa815dd6ef Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sat, 23 Nov 2024 18:48:35 +0100 Subject: [PATCH] meow clippy --- src/game/player.rs | 2 +- src/game/scene.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/player.rs b/src/game/player.rs index cf17cf2..25f73a1 100644 --- a/src/game/player.rs +++ b/src/game/player.rs @@ -83,7 +83,7 @@ pub fn add_player( mgr: anims, }, SpriteBundle { - transform: Into::::into(player_coords.clone()), + transform: (*player_coords).into(), ..Default::default() }, )); diff --git a/src/game/scene.rs b/src/game/scene.rs index c218632..c131c67 100644 --- a/src/game/scene.rs +++ b/src/game/scene.rs @@ -24,16 +24,16 @@ pub struct PlayerCoords { block_size: f32, } -impl Into for PlayerCoords { - fn into(self) -> Transform { - let PlayerCoords { x, y, block_size } = self; +impl From for Transform { + fn from(val: PlayerCoords) -> Self { + let PlayerCoords { x, y, block_size } = val; Transform { translation: Vec3 { x, y, z: PLAYER_DEPTH, }, - scale: Vec3::splat(self.block_size * PLAYER_SIZE_FRACTION), + scale: Vec3::splat(val.block_size * PLAYER_SIZE_FRACTION), ..Default::default() } }