diff --git a/src/items/primitive.rs b/src/items/primitive.rs index e1de350..d4e13b3 100644 --- a/src/items/primitive.rs +++ b/src/items/primitive.rs @@ -107,14 +107,20 @@ where O: Uint + FromStr, E: ParserError<&'a str>, { - digit1 - .void() - .take() + dec_uint_str .verify_map(|s: &str| s.parse().ok()) .parse_next(input) } -/// Parse a colon preceded by whitespace +/// Parse an unsigned decimal integer as a string slice. +pub(super) fn dec_uint_str<'a, E>(input: &mut &'a str) -> winnow::Result<&'a str, E> +where + E: ParserError<&'a str>, +{ + digit1.void().take().parse_next(input) +} + +/// Parse a colon preceded by whitespace. pub(super) fn colon<'a, E>(input: &mut &'a str) -> winnow::Result<(), E> where E: ParserError<&'a str>, diff --git a/src/items/time.rs b/src/items/time.rs index 2a79943..bbad9a8 100644 --- a/src/items/time.rs +++ b/src/items/time.rs @@ -46,7 +46,7 @@ use winnow::{ use super::{ epoch::sec_and_nsec, primitive::{colon, ctx_err, dec_uint, s}, - timezone::{timezone_num, Offset}, + timezone::{timezone_offset, Offset}, }; #[derive(PartialEq, Clone, Debug, Default)] @@ -55,7 +55,7 @@ pub(crate) struct Time { pub(crate) minute: u8, pub(crate) second: u8, pub(crate) nanosecond: u32, - pub(crate) offset: Option, + pub(super) offset: Option, } impl TryFrom