diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-08-29 16:52:48 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2021-08-29 22:51:06 -0400 |
commit | 97203ce2338a54b62080116f17b9b928279ae8c8 (patch) | |
tree | 09bbc096f9fba24fe7b9045f3aa459fce20dd5ea /src/handlers/file_meta_misc.rs | |
parent | 93aabce9490d566d184579a0f9a182fd3cbf1d48 (diff) |
Refactor: state machine handlers module
Diffstat (limited to 'src/handlers/file_meta_misc.rs')
-rw-r--r-- | src/handlers/file_meta_misc.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/handlers/file_meta_misc.rs b/src/handlers/file_meta_misc.rs new file mode 100644 index 00000000..8e095f18 --- /dev/null +++ b/src/handlers/file_meta_misc.rs @@ -0,0 +1,16 @@ +use crate::delta::{Source, State, StateMachine}; + +impl<'a> StateMachine<'a> { + #[inline] + fn test_file_meta_misc_cases(&self) -> bool { + self.source == Source::DiffUnified && self.line.starts_with("Only in ") + || self.line.starts_with("Binary files ") + } + + pub fn handle_file_meta_misc_lines(&mut self) -> std::io::Result<bool> { + if !self.test_file_meta_misc_cases() { + return Ok(false); + } + self.handle_additional_cases(State::FileMeta) + } +} |