summaryrefslogtreecommitdiffstats
path: root/src/process/state.rs
diff options
context:
space:
mode:
authorTim Oram <dev@mitmaro.ca>2020-09-19 22:11:11 -0230
committerTim Oram <dev@mitmaro.ca>2020-09-19 23:53:51 -0230
commitcb5e15ecb082581b131c844d6d2a0e070e3e2cbe (patch)
treeeb74e76ec4716a636ffbbf55e64c149645095533 /src/process/state.rs
parent7147101452e3e9455c1e7b97fe279ffc976abb99 (diff)
DRY up process module
The process module has always been fairly repetitive and adding a new module required updates to several places in the file. This change refactors the process module to use dynamic dispatch to call the functions on the ProcessModule trait dynamically. This required the error, help and window size error systems to be modified to implement the ProcessModule. The show commit module has been refactored to use the error module. And the state and modules have been extracted into their own Modules struct.
Diffstat (limited to 'src/process/state.rs')
-rw-r--r--src/process/state.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/process/state.rs b/src/process/state.rs
index a9d7899..8723634 100644
--- a/src/process/state.rs
+++ b/src/process/state.rs
@@ -1,10 +1,13 @@
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, PartialEq)]
pub enum State {
ConfirmAbort,
ConfirmRebase,
Edit,
+ Error,
Exiting,
ExternalEditor,
+ Help,
List,
ShowCommit,
+ WindowSizeError,
}