pub fn crlf<Input>() -> impl Parser<Input, Output = u8, PartialState = ()> where
Input: Stream<Token = u8>,
Input::Error: ParseError<Input::Token, Input::Range, Input::Position>,
Expand description
Parses carriage return and newline (&b"\r\n"
), returning the newline byte.
use combine::Parser;
use combine::parser::byte::crlf;
assert_eq!(crlf().parse(&b"\r\n"[..]), Ok((b'\n', &b""[..])));
assert!(crlf().parse(&b"\r"[..]).is_err());
assert!(crlf().parse(&b"\n"[..]).is_err());