From 49a300ab38a86d548b5a607113827ac9efdcf2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 21 Aug 2025 16:24:41 +0200 Subject: [PATCH] Fix `window::Icon` verbose `Debug` implementation --- core/src/window/icon.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/window/icon.rs b/core/src/window/icon.rs index 5ef0eed7..fb34ca32 100644 --- a/core/src/window/icon.rs +++ b/core/src/window/icon.rs @@ -35,7 +35,7 @@ pub fn from_rgba( } /// An window icon normally used for the titlebar or taskbar. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Icon { rgba: Vec, size: Size, @@ -48,6 +48,15 @@ impl Icon { } } +impl std::fmt::Debug for Icon { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Icon") + .field("rgba", &format!("{} pixels", self.rgba.len() / 4)) + .field("size", &self.size) + .finish() + } +} + #[derive(Debug, thiserror::Error)] /// An error produced when using [`from_rgba`] with invalid arguments. pub enum Error {