Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
patch: Remove on_event and on_update overwrites
Erik Kundt committed 2 years ago
commit 3897cfc0fdabe3d058c29fac52b2169b8611f6ee
parent 5c8ecd5f0a1983e01a42f2f608ebf9c5a7a11a7b
1 file changed +1 -32
modified bin/commands/patch/select/ui.rs
@@ -27,8 +27,7 @@ use tui::ui::widget::text::{Paragraph, ParagraphProps, ParagraphState};
use tui::ui::widget::TableUtils;
use tui::ui::widget::{self, BaseView};
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;

@@ -201,16 +200,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 = BrowsePageProps::from_callback(self.base.on_update, state)
            .unwrap_or(BrowsePageProps::from(state));
@@ -492,16 +481,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);
    }
@@ -650,16 +629,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));