From f1e5960484b4e0be06a42777d9f5ce51d050d5d3 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Tue, 25 Apr 2023 10:08:41 +1000 Subject: [PATCH] lol --- lib/src/processor/memory/mmio/gpu.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/src/processor/memory/mmio/gpu.rs b/lib/src/processor/memory/mmio/gpu.rs index 55d301b..0d7d352 100644 --- a/lib/src/processor/memory/mmio/gpu.rs +++ b/lib/src/processor/memory/mmio/gpu.rs @@ -126,11 +126,8 @@ where R: Renderer, { pub fn new(cgb: bool, window: R, tile_window_renderer: Option) -> Self { - let tile_window = if let Some(mut tile_window_renderer) = tile_window_renderer { - Some(TileWindow::new(tile_window_renderer, cgb)) - } else { - None - }; + let tile_window = tile_window_renderer + .map(|tile_window_renderer| TileWindow::new(tile_window_renderer, cgb)); let buffer = vec![ColourInner::Error.rgb_bytes(None, false).into(); WIDTH * HEIGHT]; Self {