diff --git a/src/template.pest b/src/template.pest index 12cccf553..34dbb83ee 100644 --- a/src/template.pest +++ b/src/template.pest @@ -17,7 +17,7 @@ // predecessors % ("predecessor: " commit_id) // parents % (commit_id " is a parent of " super.commit_id) -whitespace = { " " | "\n" } +whitespace = _{ " " | "\n" } escape = @{ "\\" ~ ("n" | "\"" | "\\") } literal_char = @{ !("\"" | "\\") ~ ANY } diff --git a/src/template_parser.rs b/src/template_parser.rs index 494e0d748..348868495 100644 --- a/src/template_parser.rs +++ b/src/template_parser.rs @@ -374,7 +374,7 @@ fn parse_commit_template_rule<'a>( } Box::new(ListTemplate(formatters)) } - _ => Box::new(Literal(String::new())), + other => panic!("unexpected template rule: {other:?}"), } }