From 4c39988d964094706ad26dac404047270ff3bc44 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sat, 14 Sep 2024 23:08:06 +0200 Subject: [PATCH] More verbosity reduction --- src/tui/app/machine/mod.rs | 31 +++---------------------------- src/tui/app/mod.rs | 1 + 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/tui/app/machine/mod.rs b/src/tui/app/machine/mod.rs index 0295e16..5aee12b 100644 --- a/src/tui/app/machine/mod.rs +++ b/src/tui/app/machine/mod.rs @@ -26,7 +26,7 @@ use match_state::MatchState; use reload_state::ReloadState; use search_state::SearchState; -use super::{AppMode, IAppBase}; +use super::{AppMode, IAppBase, IAppState}; pub type App = AppState< AppMachine, @@ -130,36 +130,11 @@ impl IApp for App { self } - fn state( - self, - ) -> AppState< - Self::BrowseState, - Self::InfoState, - Self::ReloadState, - Self::SearchState, - Self::FetchState, - Self::MatchState, - Self::ErrorState, - Self::CriticalState, - > { + fn state(self) -> IAppState!() { self } - fn mode( - mut self, - ) -> super::AppMode< - AppState< - Self::BrowseState, - Self::InfoState, - Self::ReloadState, - Self::SearchState, - Self::FetchState, - Self::MatchState, - Self::ErrorState, - Self::CriticalState, - >, - Self::InputMode, - > { + fn mode(mut self) -> super::AppMode { if let Some(input) = self.inner_mut().input.take() { AppMode::Input(AppInputMode::new(input, self.state())) } else { diff --git a/src/tui/app/mod.rs b/src/tui/app/mod.rs index 177860b..644f7f7 100644 --- a/src/tui/app/mod.rs +++ b/src/tui/app/mod.rs @@ -30,6 +30,7 @@ macro_rules! IAppState { Self::FetchState, Self::MatchState, Self::ErrorState, Self::CriticalState> }; } +use IAppState; pub trait IApp { type BrowseState: IAppBase + IAppInteractBrowse;