From c0966d464edaff9c84f09033627a650c700aa111 Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Sat, 30 Nov 2024 18:33:58 +0530 Subject: [PATCH] Resolve clippy warnings Remove explicit lifetime for floatcontent impl. Use div_ceil instead of manually calculating the rows for hints --- tui/src/floating_text.rs | 2 +- tui/src/hint.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tui/src/floating_text.rs b/tui/src/floating_text.rs index c2077de5..13ae33d7 100644 --- a/tui/src/floating_text.rs +++ b/tui/src/floating_text.rs @@ -171,7 +171,7 @@ impl<'a> FloatingText<'a> { } } -impl<'a> FloatContent for FloatingText<'a> { +impl FloatContent for FloatingText<'_> { fn draw(&mut self, frame: &mut Frame, area: Rect, _theme: &Theme) { let block = Block::default() .borders(Borders::ALL) diff --git a/tui/src/hint.rs b/tui/src/hint.rs index 0f77f7a5..2849961f 100644 --- a/tui/src/hint.rs +++ b/tui/src/hint.rs @@ -36,7 +36,7 @@ pub fn create_shortcut_list( .unwrap_or(0); let columns = (render_width as usize / (max_shortcut_width + 4)).max(1); - let rows = (shortcut_spans.len() + columns - 1) / columns; + let rows = shortcut_spans.len().div_ceil(columns); let mut lines: Vec> = Vec::with_capacity(rows);