mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 05:40:04 -04:00
chore: more concise Debug output for WindowId
This commit is contained in:
@@ -77,6 +77,7 @@ changelog entry.
|
|||||||
- Rename `platform::x11::XWindowType` to `platform::x11::WindowType`.
|
- Rename `platform::x11::XWindowType` to `platform::x11::WindowType`.
|
||||||
- Rename `VideoMode` to `VideoModeHandle` to represent that it doesn't hold
|
- Rename `VideoMode` to `VideoModeHandle` to represent that it doesn't hold
|
||||||
static data.
|
static data.
|
||||||
|
- Make `Debug` formatting of `WindowId` more concise.
|
||||||
- Move `dpi` types to its own crate, and re-export it from the root crate.
|
- Move `dpi` types to its own crate, and re-export it from the root crate.
|
||||||
- Replace `log` with `tracing`, use `log` feature on `tracing` to restore old
|
- Replace `log` with `tracing`, use `log` feature on `tracing` to restore old
|
||||||
behavior.
|
behavior.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ impl Drop for Window {
|
|||||||
///
|
///
|
||||||
/// Whenever you receive an event specific to a window, this event contains a `WindowId` which you
|
/// Whenever you receive an event specific to a window, this event contains a `WindowId` which you
|
||||||
/// can then compare to the ids of your windows.
|
/// can then compare to the ids of your windows.
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct WindowId(pub(crate) platform_impl::WindowId);
|
pub struct WindowId(pub(crate) platform_impl::WindowId);
|
||||||
|
|
||||||
impl WindowId {
|
impl WindowId {
|
||||||
@@ -86,6 +86,12 @@ impl WindowId {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for WindowId {
|
||||||
|
fn fmt(&self, fmtr: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(fmtr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<WindowId> for u64 {
|
impl From<WindowId> for u64 {
|
||||||
fn from(window_id: WindowId) -> Self {
|
fn from(window_id: WindowId) -> Self {
|
||||||
window_id.0.into()
|
window_id.0.into()
|
||||||
|
|||||||
Reference in New Issue
Block a user