Skip to content

Commit

Permalink
Shorter Debug formatting of LayerId
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Dec 13, 2024
1 parent 9a72ce2 commit 8cd29a6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/egui/src/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl Order {

/// An identifier for a paint layer.
/// Also acts as an identifier for [`crate::Area`]:s.
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
#[derive(Clone, Copy, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct LayerId {
pub order: Order,
Expand Down Expand Up @@ -102,6 +102,13 @@ impl LayerId {
}
}

impl std::fmt::Debug for LayerId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let Self { order, id } = self;
write!(f, "LayerId {{ {order:?} {id:?} }}")
}
}

/// A unique identifier of a specific [`Shape`] in a [`PaintList`].
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down

0 comments on commit 8cd29a6

Please sign in to comment.