From 6e3aa703984845f4c5f8ff927426e79277295fd6 Mon Sep 17 00:00:00 2001 From: futile Date: Tue, 8 Apr 2025 06:35:15 +0100 Subject: [PATCH] simplify load_icon --- src/gui.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/gui.rs b/src/gui.rs index f205768..8af139a 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -265,17 +265,13 @@ impl App { } fn load_icon() -> eframe::egui::IconData { - let (icon_rgba, icon_width, icon_height) = { - let icon = include_bytes!("../assets/icon.png"); - let image = image::load_from_memory(icon).unwrap().into_rgba8(); - let (width, height) = image.dimensions(); - let rgba = image.into_raw(); - (rgba, width, height) - }; + let icon = include_bytes!("../assets/icon.png"); + let image = image::load_from_memory(icon).unwrap().into_rgba8(); + let (width, height) = image.dimensions(); eframe::egui::IconData { - rgba: icon_rgba, - width: icon_width, - height: icon_height, + rgba: image.into_raw(), + width, + height, } }