From e3317ab430ec59e387380fddc3342c58b66a5da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com> Date: Mon, 27 Feb 2023 21:35:17 +0000 Subject: [PATCH] refactor: added default APU implementation Silences clippy. --- src/apu.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/apu.rs b/src/apu.rs index 871907b5..5992e584 100644 --- a/src/apu.rs +++ b/src/apu.rs @@ -106,11 +106,9 @@ impl Apu { } pub fn read(&mut self, addr: u16) -> u8 { - match addr { - _ => { - warnln!("Reading from unknown APU location 0x{:04x}", addr); - 0xff - } + { + warnln!("Reading from unknown APU location 0x{:04x}", addr); + 0xff } } @@ -262,3 +260,9 @@ impl Apu { self.output_buffer.clear(); } } + +impl Default for Apu { + fn default() -> Self { + Self::new() + } +} -- GitLab