Function winnow::character::streaming::line_ending
source · pub fn line_ending<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::line_ending</code> with input wrapped in <code>winnow::Partial</code>
Expand description
Recognizes an end of line (both ‘\n’ and ‘\r\n’).
Partial version: Will return Err(winnow::error::ErrMode::Incomplete(_)) if there’s not enough input data.
Example
assert_eq!(line_ending::<_, Error<_>>("\r\nc"), Ok(("c", "\r\n")));
assert_eq!(line_ending::<_, Error<_>>("ab\r\nc"), Err(ErrMode::Backtrack(Error::new("ab\r\nc", ErrorKind::CrLf))));
assert_eq!(line_ending::<_, Error<_>>(""), Err(ErrMode::Incomplete(Needed::new(1))));WARNING: Deprecated, replaced with winnow::character::line_ending with input wrapped in winnow::Partial