Function combine::parser::combinator::look_ahead
source · [−]Expand description
look_ahead(p)
acts as p
but doesn’t consume input on success.
let mut p = look_ahead(string("test"));
let result = p.parse("test str");
assert_eq!(result, Ok(("test", "test str")));
let result = p.parse("aet");
assert!(result.is_err());