Function combine::unexpected
source · pub fn unexpected<Input, S>(message: S) -> Unexpected<Input, (), S>
Expand description
Always fails with message
as an unexpected error.
Never consumes any input.
Has ()
the output type
let result = unexpected("token")
.easy_parse("a");
assert!(result.is_err());
assert!(
result.err()
.unwrap()
.errors
.iter()
.any(|m| *m == StreamError::unexpected("token"))
);