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() } }