Skip to content

Commit

Permalink
Implement Debug for a couple of structs
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Sep 27, 2023
1 parent 9fc7670 commit 7b96711
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/eframe/src/epi/icon_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ pub struct IconData {
pub height: u32,
}

impl std::fmt::Debug for IconData {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IconData")
.field("width", &self.width)
.field("height", &self.height)
.finish_non_exhaustive()
}
}

impl IconData {
/// Convert into [`image::RgbaImage`]
///
Expand Down
10 changes: 10 additions & 0 deletions crates/egui-wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ pub struct WgpuConfiguration {
pub on_surface_error: Arc<dyn Fn(wgpu::SurfaceError) -> SurfaceErrorAction>,
}

impl std::fmt::Debug for WgpuConfiguration {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("WgpuConfiguration")
.field("supported_backends", &self.supported_backends)
.field("present_mode", &self.present_mode)
.field("power_preference", &self.power_preference)
.finish_non_exhaustive()
}
}

impl Default for WgpuConfiguration {
fn default() -> Self {
Self {
Expand Down

0 comments on commit 7b96711

Please sign in to comment.