chore: fixing linter warnings

This commit is contained in:
danieleades 2023-11-28 19:02:08 +00:00 committed by GitHub
parent ebcfa5f2d0
commit 8e99406a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 79 additions and 75 deletions

View file

@ -306,7 +306,7 @@ where
}
}
if let event::Status::Captured = self.content.as_widget_mut().on_event(
if self.content.as_widget_mut().on_event(
&mut tree.children[0],
event.clone(),
layout.children().next().unwrap(),
@ -315,7 +315,8 @@ where
clipboard,
shell,
viewport,
) {
) == event::Status::Captured
{
return event::Status::Captured;
}
@ -549,6 +550,7 @@ where
/// The local state of a [`Button`].
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[allow(clippy::struct_field_names)]
pub struct State {
is_hovered: bool,
is_pressed: bool,
@ -557,8 +559,8 @@ pub struct State {
impl State {
/// Creates a new [`State`].
pub fn new() -> State {
State::default()
pub fn new() -> Self {
Self::default()
}
/// Returns whether the [`Button`] is currently focused or not.
@ -806,15 +808,15 @@ pub fn focus<Message: 'static>(id: Id) -> Command<Message> {
impl operation::Focusable for State {
fn is_focused(&self) -> bool {
State::is_focused(*self)
Self::is_focused(*self)
}
fn focus(&mut self) {
State::focus(self);
Self::focus(self);
}
fn unfocus(&mut self) {
State::unfocus(self);
Self::unfocus(self);
}
}