From 7434a7d7d58a722a593ad59a9819b33511aed838 Mon Sep 17 00:00:00 2001 From: Steven Casper Date: Sun, 6 Nov 2022 13:49:29 -0800 Subject: [PATCH] Implement Debug for `egui::Context` (#2248) * Implement Debug for Context * Update changelog --- CHANGELOG.md | 1 + crates/egui/src/context.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55db4ebe..29c34b27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG * Texture loading now takes a `TexureOptions` with minification and magnification filters ([#2224](https://github.com/emilk/egui/pull/2224)). * Added `Key::Minus` and `Key::Equals` ([#2239](https://github.com/emilk/egui/pull/2239)). * Added `egui::gui_zoom` module with helpers for scaling the whole GUI of an app ([#2239](https://github.com/emilk/egui/pull/2239)). +* Implemented `Debug` for `egui::Context` ([#2248](https://github.com/emilk/egui/pull/2248)). ### Fixed 🐛 * ⚠️ BREAKING: Fix text being too small ([#2069](https://github.com/emilk/egui/pull/2069)). diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 92b1c364..1df5ed45 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -168,6 +168,12 @@ impl ContextImpl { #[derive(Clone)] pub struct Context(Arc>); +impl std::fmt::Debug for Context { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Context").finish_non_exhaustive() + } +} + impl std::cmp::PartialEq for Context { fn eq(&self, other: &Context) -> bool { Arc::ptr_eq(&self.0, &other.0)