diff options
author | Tim Oram <dev@mitmaro.ca> | 2020-10-29 11:53:55 -0230 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2020-10-29 21:23:19 -0230 |
commit | 337daa271780f95b4b19e4e9399cf59d236eb5df (patch) | |
tree | 918212621c5b9bc02f5978135490e622178b5410 /src/confirm_abort | |
parent | 4cd7109b36d200b252c36dd29b23eb5c26a03989 (diff) |
Move git interactive to todo file module
The GitInteractive stuct is one of the oldest structs in the project and
was initially used as a catch-all for any functionality that was shared
across the application. Overtime the functionality of this file has been
moved into the various modules of the project. At this point, the only
thing the struct handles is the direct interactions with the rebase todo
file and it's lines. This finally moves the global stuct into a module.
Diffstat (limited to 'src/confirm_abort')
-rw-r--r-- | src/confirm_abort/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/confirm_abort/mod.rs b/src/confirm_abort/mod.rs index 39a4a6f..6e593a5 100644 --- a/src/confirm_abort/mod.rs +++ b/src/confirm_abort/mod.rs @@ -1,10 +1,10 @@ -use crate::git_interactive::GitInteractive; use crate::input::input_handler::{InputHandler, InputMode}; use crate::input::Input; use crate::process::exit_status::ExitStatus; use crate::process::process_module::ProcessModule; use crate::process::process_result::ProcessResult; use crate::process::state::State; +use crate::todo_file::TodoFile; use crate::view::view_data::ViewData; use crate::view::View; @@ -13,7 +13,7 @@ pub struct ConfirmAbort { } impl ProcessModule for ConfirmAbort { - fn build_view_data(&mut self, view: &View<'_>, _: &GitInteractive) -> &ViewData { + fn build_view_data(&mut self, view: &View<'_>, _: &TodoFile) -> &ViewData { let (window_width, window_height) = view.get_view_size(); self.view_data.set_view_size(window_width, window_height); self.view_data.rebuild(); @@ -23,7 +23,7 @@ impl ProcessModule for ConfirmAbort { fn handle_input( &mut self, input_handler: &InputHandler<'_>, - git_interactive: &mut GitInteractive, + rebase_todo: &mut TodoFile, _view: &View<'_>, ) -> ProcessResult { @@ -31,7 +31,7 @@ impl ProcessModule for ConfirmAbort { let mut result = ProcessResult::new().input(input); match input { Input::Yes => { - git_interactive.clear(); + rebase_todo.set_noop(); result = result.exit_status(ExitStatus::Good); }, Input::No => { @@ -90,7 +90,7 @@ mod tests { input = Input::Yes, exit_status = ExitStatus::Good ); - assert_eq!(test_context.git_interactive.get_lines().len(), 0); + assert_eq!(test_context.rebase_todo_file.get_lines().len(), 0); }, ); } |