Fix window::Icon verbose Debug implementation

This commit is contained in:
Héctor Ramón Jiménez 2025-08-21 16:24:41 +02:00
parent 04639a4194
commit 49a300ab38
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F

View file

@ -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<u8>,
size: Size<u32>,
@ -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 {