diff options
Diffstat (limited to 'vendor/time/src/parsing/combinator/rfc/rfc2234.rs')
-rw-r--r-- | vendor/time/src/parsing/combinator/rfc/rfc2234.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/time/src/parsing/combinator/rfc/rfc2234.rs b/vendor/time/src/parsing/combinator/rfc/rfc2234.rs new file mode 100644 index 000000000..675344435 --- /dev/null +++ b/vendor/time/src/parsing/combinator/rfc/rfc2234.rs @@ -0,0 +1,13 @@ +//! Rules defined in [RFC 2234]. +//! +//! [RFC 2234]: https://datatracker.ietf.org/doc/html/rfc2234 + +use crate::parsing::ParsedItem; + +/// Consume exactly one space or tab. +pub(crate) const fn wsp(input: &[u8]) -> Option<ParsedItem<'_, ()>> { + match input { + [b' ' | b'\t', rest @ ..] => Some(ParsedItem(rest, ())), + _ => None, + } +} |