pub fn fail<I, O, E>() -> impl Parser<I, Output = O, Error = E>where
E: ParseError<I>,
Expand description
A parser which always fails.
use nom::combinator::fail;
let s = "string";
assert_eq!(fail::<_, &str, _>().parse(s), Err(Err::Error((s, ErrorKind::Fail))));