Function nom8::combinator::complete
source · pub fn complete<I: Clone, O, E: ParseError<I>, F>(
f: F
) -> impl FnMut(I) -> IResult<I, O, E>where
F: Parser<I, O, E>,
👎Deprecated since 8.0.0: Replaced with `Parser::complete
Expand description
Transforms Incomplete into Error
.
WARNING: Deprecated, replaced with Parser::complete
use nom8::bytes::take;
use nom8::combinator::complete;
let mut parser = complete(take(5u8));
assert_eq!(parser(Streaming("abcdefg")), Ok((Streaming("fg"), "abcde")));
assert_eq!(parser(Streaming("abcd")), Err(Err::Error((Streaming("abcd"), ErrorKind::Complete))));