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 {