diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.rs | 19 | ||||
-rw-r--r-- | src/main.rs | 6 | ||||
-rw-r--r-- | src/process/mod.rs | 3 | ||||
-rw-r--r-- | src/process/state.rs | 17 |
4 files changed, 24 insertions, 21 deletions
diff --git a/src/application.rs b/src/application.rs index f249766..e55aa95 100644 --- a/src/application.rs +++ b/src/application.rs @@ -5,6 +5,7 @@ use crate::config::Config; use crate::constants::{LIST_HELP_LINES, VISUAL_MODE_HELP_LINES}; use crate::exit_status::ExitStatus; use crate::input::{Input, InputHandler}; +use crate::process::State; use crate::view::View; use crate::window::Window; use core::borrow::Borrow; @@ -13,24 +14,6 @@ use std::process::Command; use std::process::ExitStatus as ProcessExitStatus; use unicode_segmentation::UnicodeSegmentation; -#[derive(Clone, Debug, PartialEq)] -pub enum State { - ConfirmAbort, - ConfirmRebase, - Edit, - EditFinish, - Error { return_state: Box<State>, message: String }, - Exiting, - ExternalEditor(Box<State>), - ExternalEditorError, - ExternalEditorFinish(Box<State>), - Help(Box<State>), - List, - ShowCommit, - VisualMode, - WindowSizeError(Box<State>), -} - pub struct Application<'a> { config: &'a Config, edit_content: String, diff --git a/src/main.rs b/src/main.rs index d88e12f..bc9b61a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ mod exit_status; mod git_interactive; mod input; mod line; +mod process; mod scroll; mod view; mod window; @@ -23,7 +24,6 @@ use crate::git_interactive::GitInteractive; use crate::input::InputHandler; use crate::view::View; use crate::window::Window; -use std::process; struct Exit { message: String, @@ -32,10 +32,10 @@ struct Exit { fn main() { match try_main() { - Ok(code) => process::exit(code.to_code()), + Ok(code) => std::process::exit(code.to_code()), Err(err) => { eprintln!("{}", err.message); - process::exit(err.status.to_code()); + std::process::exit(err.status.to_code()); }, } } diff --git a/src/process/mod.rs b/src/process/mod.rs new file mode 100644 index 0000000..2927499 --- /dev/null +++ b/src/process/mod.rs @@ -0,0 +1,3 @@ +mod state; + +pub use self::state::State; diff --git a/src/process/state.rs b/src/process/state.rs new file mode 100644 index 0000000..3d98c29 --- /dev/null +++ b/src/process/state.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, PartialEq)] +pub enum State { + ConfirmAbort, + ConfirmRebase, + Edit, + EditFinish, + Error { return_state: Box<State>, message: String }, + Exiting, + ExternalEditor(Box<State>), + ExternalEditorError, + ExternalEditorFinish(Box<State>), + Help(Box<State>), + List, + ShowCommit, + VisualMode, + WindowSizeError(Box<State>), +} |