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); diff --git a/tui/src/main.rs b/tui/src/main.rs index ee0c3235..76ef584f 100644 --- a/tui/src/main.rs +++ b/tui/src/main.rs @@ -5,7 +5,7 @@ mod floating_text; mod hint; mod root; mod running_command; -pub mod state; +mod state; mod theme; #[cfg(feature = "tips")] diff --git a/tui/src/state.rs b/tui/src/state.rs index cec9cc3c..aee17b97 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -480,7 +480,7 @@ impl AppState { } match &mut self.focus { Focus::FloatingWindow(float) => { - float.content.handle_mouse_event(event); + float.handle_mouse_event(event); } Focus::ConfirmationPrompt(confirm) => { confirm.content.handle_mouse_event(event);