From fc303b6265f159a69264201dd72bf7baafbd9460 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 20 Mar 2021 21:10:48 -0500 Subject: [PATCH] chore: rename "as u8" to "as Self" when implementing From Trait --- src/ppu.rs | 10 +++++----- src/sound.rs | 2 +- src/timer.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ppu.rs b/src/ppu.rs index be6f521..f9a5e18 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -250,7 +250,7 @@ impl From for Mode { impl From for u8 { fn from(mode: Mode) -> Self { - mode as u8 + mode as Self } } @@ -326,7 +326,7 @@ impl From for TileMapAddress { impl From for u8 { fn from(reg: TileMapAddress) -> Self { - reg as u8 + reg as Self } } @@ -354,7 +354,7 @@ impl From for TileDataAddress { impl From for u8 { fn from(reg: TileDataAddress) -> Self { - reg as u8 + reg as Self } } @@ -382,7 +382,7 @@ impl From for ObjectSize { impl From for u8 { fn from(size: ObjectSize) -> Self { - size as u8 + size as Self } } @@ -431,7 +431,7 @@ impl From for GrayShade { impl From for u8 { fn from(shade: GrayShade) -> Self { - shade as u8 + shade as Self } } diff --git a/src/sound.rs b/src/sound.rs index 7669070..729050e 100644 --- a/src/sound.rs +++ b/src/sound.rs @@ -253,7 +253,7 @@ impl Default for WavePattern { impl From for u8 { fn from(pattern: WavePattern) -> Self { - pattern as u8 + pattern as Self } } diff --git a/src/timer.rs b/src/timer.rs index 4d452d0..791b484 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -43,7 +43,7 @@ impl From for TimerSpeed { impl From for u8 { fn from(speed: TimerSpeed) -> Self { - speed as u8 + speed as Self } }