Skip to content

Commit 8edbd6e

Browse files
committed
Clippy
1 parent 1824d74 commit 8edbd6e

File tree

4 files changed

+0
-42
lines changed

4 files changed

+0
-42
lines changed

codex-rs/tui/src/bottom_pane/bottom_pane_view.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ use ratatui::layout::Rect;
55

66
use super::BottomPane;
77

8-
/// Type to use for a method that may require a redraw of the UI.
9-
pub(crate) enum ConditionalUpdate {
10-
NeedsRedraw,
11-
NoRedraw,
12-
}
13-
148
/// Trait implemented by every view that can be shown in the bottom pane.
159
pub(crate) trait BottomPaneView<'a> {
1610
/// Handle a key event while the view is active. A redraw is always
@@ -28,11 +22,6 @@ pub(crate) trait BottomPaneView<'a> {
2822
/// Render the view: this will be displayed in place of the composer.
2923
fn render(&self, area: Rect, buf: &mut Buffer);
3024

31-
/// Update the status indicator text.
32-
fn update_status_text(&mut self, _text: String) -> ConditionalUpdate {
33-
ConditionalUpdate::NoRedraw
34-
}
35-
3625
/// Called when task completes to check if the view should be hidden.
3726
fn should_hide_when_task_is_done(&mut self) -> bool {
3827
false

codex-rs/tui/src/bottom_pane/mod.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Bottom pane: shows the ChatComposer or a BottomPaneView, if one is active.
22
33
use bottom_pane_view::BottomPaneView;
4-
use bottom_pane_view::ConditionalUpdate;
54
use crossterm::event::KeyEvent;
65
use ratatui::buffer::Buffer;
76
use ratatui::layout::Rect;
@@ -78,21 +77,6 @@ impl BottomPane<'_> {
7877
}
7978
}
8079

81-
/// Update the status indicator text (only when the `StatusIndicatorView` is
82-
/// active).
83-
pub(crate) fn update_status_text(&mut self, text: String) {
84-
if let Some(view) = &mut self.active_view {
85-
match view.update_status_text(text) {
86-
ConditionalUpdate::NeedsRedraw => {
87-
self.request_redraw();
88-
}
89-
ConditionalUpdate::NoRedraw => {
90-
// No redraw needed.
91-
}
92-
}
93-
}
94-
}
95-
9680
/// Update the UI to reflect whether this `BottomPane` has input focus.
9781
pub(crate) fn set_input_focus(&mut self, has_focus: bool) {
9882
self.has_input_focus = has_focus;

codex-rs/tui/src/bottom_pane/status_indicator_view.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::app_event_sender::AppEventSender;
66
use crate::status_indicator_widget::StatusIndicatorWidget;
77

88
use super::BottomPaneView;
9-
use super::bottom_pane_view::ConditionalUpdate;
109

1110
pub(crate) struct StatusIndicatorView {
1211
view: StatusIndicatorWidget,
@@ -18,18 +17,9 @@ impl StatusIndicatorView {
1817
view: StatusIndicatorWidget::new(app_event_tx, height),
1918
}
2019
}
21-
22-
pub fn update_text(&mut self, text: String) {
23-
self.view.update_text(text);
24-
}
2520
}
2621

2722
impl<'a> BottomPaneView<'a> for StatusIndicatorView {
28-
fn update_status_text(&mut self, text: String) -> ConditionalUpdate {
29-
self.update_text(text);
30-
ConditionalUpdate::NeedsRedraw
31-
}
32-
3323
fn should_hide_when_task_is_done(&mut self) -> bool {
3424
true
3525
}

codex-rs/tui/src/status_indicator_widget.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ impl StatusIndicatorWidget {
8383
pub(crate) fn get_height(&self) -> u16 {
8484
self.height
8585
}
86-
87-
/// Update the line that is displayed in the widget.
88-
pub(crate) fn update_text(&mut self, text: String) {
89-
self.text = text.replace(['\n', '\r'], " ");
90-
}
9186
}
9287

9388
impl Drop for StatusIndicatorWidget {

0 commit comments

Comments
 (0)