Environment
Problem
When using recognize((satisfy(|c| c.is_uppercase()), alpha0)) parser, this produces only the first character of Hello.
#[test]
fn test_name() {
let testing = || -> IResult<_, _> {
recognize((satisfy(|c: char| c.is_uppercase()), alpha0)).parse("Hello")
};
let (rest, name) = testing().unwrap();
println!("Name: {name:?}");
println!("Rest: {rest:?}");
}
This prints:
When I change it to use just the inner tuple: (satisfy(|c: char| c.is_uppercase()), alpha0)
Name: ('H', "ello")
Rest: ""
Environment
Problem
When using
recognize((satisfy(|c| c.is_uppercase()), alpha0))parser, this produces only the first character ofHello.This prints:
When I change it to use just the inner tuple:
(satisfy(|c: char| c.is_uppercase()), alpha0)