From b654808734778ef53343a6990c15110b9cae9886 Mon Sep 17 00:00:00 2001 From: Chris Glass Date: Fri, 10 Apr 2026 18:40:26 +0200 Subject: [PATCH] Ingore clippy warnings about too many arguments --- src/terminal.rs | 23 +++++++++++++---------- src/terminal_box.rs | 36 ++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/terminal.rs b/src/terminal.rs index ce7d6d3..2dd8343 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -264,6 +264,7 @@ pub struct Terminal { impl Terminal { //TODO: error handling + #[allow(clippy::too_many_arguments)] pub fn new( pane: pane_grid::Pane, entity: segmented_button::Entity, @@ -860,10 +861,11 @@ impl Terminal { // Change color if selected if let Some(selection) = &term.selection && let Some(range) = selection.to_range(&term) - && range.contains(indexed.point) { - //TODO: better handling of selection - mem::swap(&mut fg, &mut bg); - } + && range.contains(indexed.point) + { + //TODO: better handling of selection + mem::swap(&mut fg, &mut bg); + } // Convert foreground to linear attrs = attrs.color(fg); @@ -877,9 +879,10 @@ impl Terminal { let mut flags = indexed.cell.flags; if let Some(active_match) = &self.active_regex_match - && active_match.contains(&indexed.point) { - flags |= Flags::UNDERLINE; - } + && active_match.contains(&indexed.point) + { + flags |= Flags::UNDERLINE; + } if let Some(active_id) = &self.active_hyperlink_id { let mut matches_active = indexed .cell @@ -1191,9 +1194,9 @@ impl<'a, T> Iterator for HintPostProcessor<'a, T> { && let Some(rm) = self .term .regex_search_right(self.regex, self.start, self.end) - { - self.next_processed_match(rm); - } + { + self.next_processed_match(rm); + } Some(next_match) } diff --git a/src/terminal_box.rs b/src/terminal_box.rs index 2f22912..6b3a969 100644 --- a/src/terminal_box.rs +++ b/src/terminal_box.rs @@ -871,9 +871,10 @@ where layout.bounds(), self.padding, multiplier, - ) { - shell.capture_event(); - } + ) + { + shell.capture_event(); + } if state.autoscroll.is_active() { shell.request_redraw(); } @@ -1323,15 +1324,15 @@ where last_side, .. } = dragging + { { - { - let mut term = terminal.term.lock(); - if let Some(selection) = &mut term.selection { - selection.update(last_point, last_side); - } + let mut term = terminal.term.lock(); + if let Some(selection) = &mut term.selection { + selection.update(last_point, last_side); } - terminal.needs_update = true; } + terminal.needs_update = true; + } if let Some(p) = cursor_position.position_in(layout.bounds()) { let x = p.x - self.padding.left; let y = p.y - self.padding.top; @@ -1343,10 +1344,11 @@ where .viewport_to_point(TermPoint::new(row as usize, TermColumn(col as usize))); if state.modifiers.control() && let Some(on_open_hyperlink) = &self.on_open_hyperlink - && let Some(hyperlink) = get_hyperlink(&terminal, location) { - shell.publish(on_open_hyperlink(hyperlink)); - shell.capture_event(); - } + && let Some(hyperlink) = get_hyperlink(&terminal, location) + { + shell.publish(on_open_hyperlink(hyperlink)); + shell.capture_event(); + } if is_mouse_mode { terminal.report_mouse( @@ -1651,9 +1653,10 @@ fn update_active_regex_match( { 'update: { if let Some(active_match) = &terminal.active_regex_match - && active_match == match_ { - break 'update; - } + && active_match == match_ + { + break 'update; + } terminal.active_regex_match = Some(match_.clone()); terminal.needs_update = true; } @@ -1713,6 +1716,7 @@ enum EdgeScrollDirection { Bottom, } +#[allow(clippy::too_many_arguments)] fn edge_scroll_adjustment( y: f32, buffer_height: f32,