summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2019-07-13 11:05:56 -0400
committerDan Davison <dandavison7@gmail.com>2019-07-13 11:06:50 -0400
commit4052b9c47a2f6f45385c71f794494b9b160b8ed9 (patch)
treed1825443fb8c268e023b933c0784d89c18fb0ff1 /src
parent118c617a13bbea60a098b0d8e894e4a101067483 (diff)
Change name of state in state machine
Diffstat (limited to 'src')
-rw-r--r--src/parse.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/parse.rs b/src/parse.rs
index 2111d6a2..3afa31cb 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -14,12 +14,12 @@ use crate::parse::parse_git_diff::{
#[derive(Debug, PartialEq)]
pub enum State {
- Commit, // In commit metadata section
- FileMeta, // In diff metadata section, between commit metadata and first hunk
- HunkMeta, // In hunk metadata line
- HunkZero, // In hunk; unchanged line
- HunkMinus, // In hunk; removed line
- HunkPlus, // In hunk; added line
+ CommitMeta, // In commit metadata section
+ FileMeta, // In diff metadata section, between commit metadata and first hunk
+ HunkMeta, // In hunk metadata line
+ HunkZero, // In hunk; unchanged line
+ HunkMinus, // In hunk; removed line
+ HunkPlus, // In hunk; added line
Unknown,
}
@@ -35,14 +35,14 @@ impl State {
// Possible transitions, with actions on entry:
//
//
-// | from \ to | Commit | FileMeta | HunkMeta | HunkZero | HunkMinus | HunkPlus |
-// |-----------+-------------+-------------+-------------+-------------+-------------+----------|
-// | Commit | emit | emit | | | | |
-// | FileMeta | | emit | emit | | | |
-// | HunkMeta | | | | emit | push | push |
-// | HunkZero | emit | emit | emit | emit | push | push |
-// | HunkMinus | flush, emit | flush, emit | flush, emit | flush, emit | push | push |
-// | HunkPlus | flush, emit | flush, emit | flush, emit | flush, emit | flush, push | push |
+// | from \ to | CommitMeta | FileMeta | HunkMeta | HunkZero | HunkMinus | HunkPlus |
+// |------------+-------------+-------------+-------------+-------------+-------------+----------|
+// | CommitMeta | emit | emit | | | | |
+// | FileMeta | | emit | emit | | | |
+// | HunkMeta | | | | emit | push | push |
+// | HunkZero | emit | emit | emit | emit | push | push |
+// | HunkMinus | flush, emit | flush, emit | flush, emit | flush, emit | push | push |
+// | HunkPlus | flush, emit | flush, emit | flush, emit | flush, emit | flush, push | push |
pub fn delta(
lines: impl Iterator<Item = String>,
@@ -68,7 +68,7 @@ pub fn delta(
let line = strip_ansi_codes(&raw_line).to_string();
if line.starts_with("commit") {
painter.paint_buffered_lines();
- state = State::Commit;
+ state = State::CommitMeta;
if config.opt.commit_style != cli::SectionStyle::Plain {
let draw_fn = match config.opt.commit_style {
cli::SectionStyle::Box => draw::write_boxed_with_line,