From 4dfb6a27004ecf309b73c440b8cde78355c49448 Mon Sep 17 00:00:00 2001 From: genusistimelord Date: Thu, 27 Jun 2024 16:34:33 -0400 Subject: [PATCH] Ignoring some Broken Clippy calls and Fixing some actual clippy issues. --- src/lib.rs | 5 +++- src/widgets/overlay/color_picker.rs | 38 +++++------------------------ src/widgets/overlay/date_picker.rs | 32 +++--------------------- src/widgets/overlay/time_picker.rs | 33 ++++--------------------- 4 files changed, 19 insertions(+), 89 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 75378526..eb284467 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,7 +43,10 @@ clippy::missing_const_for_fn, clippy::too_many_lines, clippy::cast_precision_loss, - clippy::missing_docs_in_private_items + clippy::missing_docs_in_private_items, + clippy::unit_arg, + clippy::trivially_copy_pass_by_ref, + clippy::let_unit_value )] pub mod widgets; diff --git a/src/widgets/overlay/color_picker.rs b/src/widgets/overlay/color_picker.rs index 61431d6a..20edc30c 100644 --- a/src/widgets/overlay/color_picker.rs +++ b/src/widgets/overlay/color_picker.rs @@ -142,9 +142,6 @@ where event: &Event, layout: Layout<'_>, cursor: Cursor, - _shell: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, ) -> event::Status { let mut hsv_color_children = layout.children(); @@ -258,9 +255,6 @@ where event: &Event, layout: Layout<'_>, cursor: Cursor, - _shell: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, ) -> event::Status { let mut rgba_color_children = layout.children(); let mut color_changed = false; @@ -424,15 +418,7 @@ where } /// The even handling for the keyboard input. - fn on_event_keyboard( - &mut self, - event: &Event, - _layout: Layout<'_>, - _cursor: Cursor, - _shell: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, - ) -> event::Status { + fn on_event_keyboard(&mut self, event: &Event) -> event::Status { if self.state.focus == Focus::None { return event::Status::Ignored; } @@ -610,10 +596,10 @@ where .bounds(); // ----------- Block 1 ---------------------- - let block1_node = block1_layout(self, renderer, block1_bounds, self.position); + let block1_node = block1_layout(self, renderer, block1_bounds); // ----------- Block 2 ---------------------- - let block2_node = block2_layout(self, renderer, block2_bounds, self.position); + let block2_node = block2_layout(self, renderer, block2_bounds); let (width, height) = if bounds.width > bounds.height { ( @@ -643,9 +629,7 @@ where clipboard: &mut dyn Clipboard, shell: &mut Shell, ) -> event::Status { - if event::Status::Captured - == self.on_event_keyboard(&event, layout, cursor, shell, renderer, clipboard) - { + if event::Status::Captured == self.on_event_keyboard(&event) { self.state.sat_value_canvas_cache.clear(); self.state.hue_canvas_cache.clear(); return event::Status::Captured; @@ -659,8 +643,7 @@ where let block1_layout = children .next() .expect("widgets: Layout should have a 1. block layout"); - let hsv_color_status = - self.on_event_hsv_color(&event, block1_layout, cursor, shell, renderer, clipboard); + let hsv_color_status = self.on_event_hsv_color(&event, block1_layout, cursor); // ----------- Block 1 end ------------------ // ----------- Block 2 ---------------------- @@ -673,14 +656,7 @@ where let rgba_color_layout = block2_children .next() .expect("widgets: Layout should have a RGBA color layout"); - let rgba_color_status = self.on_event_rgba_color( - &event, - rgba_color_layout, - cursor, - shell, - renderer, - clipboard, - ); + let rgba_color_status = self.on_event_rgba_color(&event, rgba_color_layout, cursor); let mut fake_messages: Vec = Vec::new(); @@ -923,7 +899,6 @@ fn block1_layout<'a, Message, Theme>( color_picker: &mut ColorPickerOverlay<'_, '_, Message, Theme>, renderer: &Renderer, bounds: Rectangle, - _position: Point, ) -> Node where Message: 'static + Clone, @@ -958,7 +933,6 @@ fn block2_layout<'a, Message, Theme>( color_picker: &mut ColorPickerOverlay<'_, '_, Message, Theme>, renderer: &Renderer, bounds: Rectangle, - _position: Point, ) -> Node where Message: 'static + Clone, diff --git a/src/widgets/overlay/date_picker.rs b/src/widgets/overlay/date_picker.rs index 9e5ea105..24b93846 100644 --- a/src/widgets/overlay/date_picker.rs +++ b/src/widgets/overlay/date_picker.rs @@ -146,9 +146,6 @@ where event: &Event, layout: Layout<'_>, cursor: Cursor, - _messages: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, ) -> event::Status { let mut children = layout.children(); @@ -237,9 +234,6 @@ where event: &Event, layout: Layout<'_>, cursor: Cursor, - _messages: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, ) -> event::Status { let mut children = layout.children(); @@ -296,15 +290,7 @@ where } /// The event handling for the keyboard input. - fn on_event_keyboard( - &mut self, - event: &Event, - _layout: Layout<'_>, - _cursor: Cursor, - _messages: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, - ) -> event::Status { + fn on_event_keyboard(&mut self, event: &Event) -> event::Status { if self.state.focus == Focus::None { return event::Status::Ignored; } @@ -562,9 +548,7 @@ where clipboard: &mut dyn Clipboard, shell: &mut Shell, ) -> event::Status { - if event::Status::Captured - == self.on_event_keyboard(&event, layout, cursor, shell, renderer, clipboard) - { + if event::Status::Captured == self.on_event_keyboard(&event) { return event::Status::Captured; } @@ -579,14 +563,7 @@ where let month_year_layout = date_children .next() .expect("widgets: Layout should have a month/year layout"); - let month_year_status = self.on_event_month_year( - &event, - month_year_layout, - cursor, - shell, - renderer, - clipboard, - ); + let month_year_status = self.on_event_month_year(&event, month_year_layout, cursor); // ----------- Days ---------------------- let days_layout = date_children @@ -595,8 +572,7 @@ where .children() .next() .expect("widgets: Layout should have a days table layout"); - let days_status = - self.on_event_days(&event, days_layout, cursor, shell, renderer, clipboard); + let days_status = self.on_event_days(&event, days_layout, cursor); // ----------- Buttons ------------------------ let cancel_button_layout = children diff --git a/src/widgets/overlay/time_picker.rs b/src/widgets/overlay/time_picker.rs index 5bb04f6f..d04b3bd4 100644 --- a/src/widgets/overlay/time_picker.rs +++ b/src/widgets/overlay/time_picker.rs @@ -148,9 +148,6 @@ where event: &Event, layout: Layout<'_>, cursor: Cursor, - _shell: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, ) -> event::Status { if cursor.is_over(layout.bounds()) { self.state.clock_cache_needs_clearance = true; @@ -321,9 +318,6 @@ where event: &Event, layout: Layout<'_>, cursor: Cursor, - _shell: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, ) -> event::Status { let mut digital_clock_children = layout.children(); @@ -451,15 +445,7 @@ where } /// The event handling for the keyboard input. - fn on_event_keyboard( - &mut self, - event: &Event, - _layout: Layout<'_>, - _cursor: Cursor, - _shell: &mut Shell, - _renderer: &Renderer, - _clipboard: &mut dyn Clipboard, - ) -> event::Status { + fn on_event_keyboard(&mut self, event: &Event) -> event::Status { if self.state.focus == Focus::None { return event::Status::Ignored; } @@ -629,9 +615,7 @@ where clipboard: &mut dyn Clipboard, shell: &mut Shell, ) -> event::Status { - if event::Status::Captured - == self.on_event_keyboard(&event, layout, cursor, shell, renderer, clipboard) - { + if event::Status::Captured == self.on_event_keyboard(&event) { return event::Status::Captured; } @@ -641,8 +625,7 @@ where let clock_layout = children .next() .expect("widgets: Layout should have a clock canvas layout"); - let clock_status = - self.on_event_clock(&event, clock_layout, cursor, shell, renderer, clipboard); + let clock_status = self.on_event_clock(&event, clock_layout, cursor); // ----------- Digital clock ------------------ let digital_clock_layout = children @@ -651,14 +634,8 @@ where .children() .next() .expect("widgets: Layout should have a digital clock layout"); - let digital_clock_status = self.on_event_digital_clock( - &event, - digital_clock_layout, - cursor, - shell, - renderer, - clipboard, - ); + let digital_clock_status = + self.on_event_digital_clock(&event, digital_clock_layout, cursor); // ----------- Buttons ------------------------ let cancel_button_layout = children