time/parsing/combinator/rfc/
rfc2234.rs

1//! Rules defined in [RFC 2234].
2//!
3//! [RFC 2234]: https://datatracker.ietf.org/doc/html/rfc2234
4
5use crate::parsing::ParsedItem;
6
7/// Consume exactly one space or tab.
8#[inline]
9pub(crate) const fn wsp(input: &[u8]) -> Option<ParsedItem<'_, ()>> {
10    match input {
11        [b' ' | b'\t', rest @ ..] => Some(ParsedItem(rest, ())),
12        _ => None,
13    }
14}