Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
inbox: Remove on_event and on_update overwrites
Erik Kundt committed 2 years ago
commit 4294a5e9532a485f4e35eb04fe417c00ae890523
parent 2871f998ce599a4b1c472dc6559396db27ca041f
1 file changed +1 -32
modified bin/commands/inbox/select/ui.rs
@@ -23,8 +23,7 @@ use tui::ui::widget::input::{TextField, TextFieldProps, TextFieldState};
use tui::ui::widget::text::{Paragraph, ParagraphProps, ParagraphState};
use tui::ui::widget::{self, BaseView, TableUtils};
use tui::ui::widget::{
-
    Column, EventCallback, Properties, Shortcuts, ShortcutsProps, Table, TableProps,
-
    UpdateCallback, View, Widget,
+
    Column, Properties, Shortcuts, ShortcutsProps, Table, TableProps, View, Widget,
};
use tui::Selection;

@@ -197,16 +196,6 @@ where
        &mut self.base
    }

-
    fn on_event(mut self, callback: EventCallback<Action>) -> Self {
-
        self.base.on_event = Some(callback);
-
        self
-
    }
-

-
    fn on_update(mut self, callback: UpdateCallback<State>) -> Self {
-
        self.base.on_update = Some(callback);
-
        self
-
    }
-

    fn update(&mut self, state: &State) {
        self.props = BrowsePageProps::from_callback(self.base.on_update, state)
            .unwrap_or(BrowsePageProps::from(state));
@@ -445,16 +434,6 @@ impl<B: Backend> View<State, Action> for Search<B> {
        &mut self.base
    }

-
    fn on_update(mut self, callback: UpdateCallback<State>) -> Self {
-
        self.base.on_update = Some(callback);
-
        self
-
    }
-

-
    fn on_event(mut self, callback: EventCallback<Action>) -> Self {
-
        self.base.on_event = Some(callback);
-
        self
-
    }
-

    fn update(&mut self, state: &State) {
        self.input.update(state);
    }
@@ -603,16 +582,6 @@ where
        &mut self.base
    }

-
    fn on_update(mut self, callback: UpdateCallback<State>) -> Self {
-
        self.base.on_update = Some(callback);
-
        self
-
    }
-

-
    fn on_event(mut self, callback: EventCallback<Action>) -> Self {
-
        self.base.on_event = Some(callback);
-
        self
-
    }
-

    fn update(&mut self, state: &State) {
        self.props = HelpPageProps::from_callback(self.base.on_update, state)
            .unwrap_or(HelpPageProps::from(state));