diff options
author | 2023-10-27 05:08:06 +0200 | |
---|---|---|
committer | 2023-10-27 05:08:06 +0200 | |
commit | e579d8553088c7d17784e7ff8f6e21360c2bd9ef (patch) | |
tree | 68baf4656d413135279cb8dec87da1dbd61726ac /widget/src/text_editor.rs | |
parent | 625cd745f38215b1cb8f629cdc6d2fa41c9a739a (diff) | |
download | iced-e579d8553088c7d17784e7ff8f6e21360c2bd9ef.tar.gz iced-e579d8553088c7d17784e7ff8f6e21360c2bd9ef.tar.bz2 iced-e579d8553088c7d17784e7ff8f6e21360c2bd9ef.zip |
Implement missing debug implementations in `iced_widget`
Diffstat (limited to 'widget/src/text_editor.rs')
-rw-r--r-- | widget/src/text_editor.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index da1905dc..ac24920f 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -14,6 +14,7 @@ use crate::core::{ }; use std::cell::RefCell; +use std::fmt; use std::ops::DerefMut; use std::sync::Arc; @@ -21,6 +22,7 @@ pub use crate::style::text_editor::{Appearance, StyleSheet}; pub use text::editor::{Action, Edit, Motion}; /// A multi-line text input. +#[allow(missing_debug_implementations)] pub struct TextEditor<'a, Highlighter, Message, Renderer = crate::Renderer> where Highlighter: text::Highlighter, @@ -257,6 +259,21 @@ where } } +impl<Renderer> fmt::Debug for Content<Renderer> +where + Renderer: text::Renderer, + Renderer::Editor: fmt::Debug, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let internal = self.0.borrow(); + + f.debug_struct("Content") + .field("editor", &internal.editor) + .field("is_dirty", &internal.is_dirty) + .finish() + } +} + struct State<Highlighter: text::Highlighter> { is_focused: bool, last_click: Option<mouse::Click>, |