I am trying to use nom's tuple function. The documentation presents the following example:
use nom::sequence::tuple;
use nom::character::complete::{alpha1, digit1};
let parser = tuple((alpha1, digit1, alpha1));
When I try it out, I get a compile error:
error[E0283]: type annotations needed
--> src/main.rs:20:18
|
20 | let parser = tuple((alpha1, digit1, alpha1));
| ------ ^^^^^ cannot infer type for type parameter `I` declared on the function `tuple`
| |
| consider giving `parser` a type
|
If I wanted to add a type to the variable, what would it be? I know it has to be some variation of FnMut, but I am unsure how it would work exactly.
Cargo.toml
[dependencies]
nom = ">=5.0"