Function combine::parser::char::crlf

source ·
pub fn crlf<Input>() -> impl Parser<Input, Output = char, PartialState = ()>
where Input: Stream<Token = char>,
Expand description

Parses carriage return and newline ("\r\n"), returning the newline character.

use combine::Parser;
use combine::parser::char::crlf;
assert_eq!(crlf().parse("\r\n"), Ok(('\n', "")));
assert!(crlf().parse("\r").is_err());
assert!(crlf().parse("\n").is_err());