diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index ae3b7087..a630e561 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -170,7 +170,7 @@ impl<'a, Highlighter, Message, Theme, Renderer> TextEditor<'a, Highlighter, Message, Theme, Renderer> where Highlighter: text::Highlighter, - Theme: Catalog + 'static + PartialEq, + Theme: Catalog + 'static, Renderer: text::Renderer, { /// Sets the placeholder of the [`TextEditor`]. @@ -508,7 +508,7 @@ where /// The state of a [`TextEditor`]. #[derive(Debug)] -pub struct State { +pub struct State { focus: Option, preedit: Option, last_click: Option, @@ -548,17 +548,15 @@ impl Focus { } } -impl - State -{ +impl State { /// Returns whether the [`TextEditor`] is currently focused or not. pub fn is_focused(&self) -> bool { self.focus.is_some() } } -impl - operation::Focusable for State +impl operation::Focusable + for State { fn is_focused(&self) -> bool { self.focus.is_some() @@ -577,7 +575,7 @@ impl Widget for TextEditor<'_, Highlighter, Message, Theme, Renderer> where Highlighter: text::Highlighter, - Theme: Catalog + 'static + PartialEq + Clone, + Theme: Catalog + 'static, Renderer: text::Renderer, { fn tag(&self) -> widget::tree::Tag { @@ -789,9 +787,9 @@ where }, Update::Binding(binding) => { fn apply_binding< - T: PartialEq + 'static, H: text::Highlighter, R: text::Renderer, + T, Message, >( binding: Binding, @@ -1091,7 +1089,7 @@ impl<'a, Highlighter, Message, Theme, Renderer> where Highlighter: text::Highlighter, Message: 'a, - Theme: Catalog + 'static + PartialEq + Clone, + Theme: Catalog + 'static, Renderer: text::Renderer, { fn from( @@ -1247,7 +1245,7 @@ enum Ime { } impl Update { - fn from_event( + fn from_event( event: &Event, state: &State, bounds: Rectangle, @@ -1406,7 +1404,7 @@ pub struct Style { } /// The theme catalog of a [`TextEditor`]. -pub trait Catalog { +pub trait Catalog: PartialEq + Clone { /// The item class of the [`Catalog`]. type Class<'a>;