Implement missing debug implementations in iced_widget
This commit is contained in:
parent
625cd745f3
commit
e579d85530
2 changed files with 18 additions and 1 deletions
|
|
@ -4,7 +4,7 @@
|
|||
)]
|
||||
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||
#![deny(
|
||||
//missing_debug_implementations,
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
unused_results,
|
||||
rustdoc::broken_intra_doc_links
|
||||
|
|
|
|||
|
|
@ -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>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue