Refactor CLI argument parsing

This commit is contained in:
Joscha 2022-01-07 20:04:31 +01:00
parent 4a46e70a73
commit 2f6911eeca
5 changed files with 112 additions and 45 deletions

View file

@ -49,7 +49,7 @@ fn parse_timezone(p: Pair<'_, Rule>) -> Spanned<String> {
Spanned::new(span, name)
}
fn parse_number(p: Pair<'_, Rule>) -> i32 {
pub fn parse_number(p: Pair<'_, Rule>) -> i32 {
assert_eq!(p.as_rule(), Rule::number);
p.as_str().parse().unwrap()
}