pub fn crlf<T, E: ParseError<T>>(
input: T
) -> IResult<T, <T as Stream>::Slice, E>where
T: Stream + Compare<&'static str>,👎Deprecated since 0.1.0: Replaced with <code>winnow::character::crlf</code>
Expand description
Recognizes the string “\r\n”.
Complete version: Will return an error if there’s not enough input data.
Example
fn parser(input: &str) -> IResult<&str, &str> {
crlf(input)
}
assert_eq!(parser("\r\nc"), Ok(("c", "\r\n")));
assert_eq!(parser("ab\r\nc"), Err(ErrMode::Backtrack(Error::new("ab\r\nc", ErrorKind::CrLf))));
assert_eq!(parser(""), Err(ErrMode::Backtrack(Error::new("", ErrorKind::CrLf))));WARNING: Deprecated, replaced with winnow::character::crlf