Currently the static info for parsers (name, spec) is tied to the Parser<Input> trait. This info never varies depending on the the input type, so when there are multiple Parser<Input> impls, we end up with duplicate impls and ambiguity requiring calls like this: Parser::<&str>::name(self) rather than self.name().
A better impl would be to split them out into a single ParserInfo trait:
trait ParserInfo {
fn name(&self) -> String;
fn spec(&self) -> ParserSpec;
}
Currently the static info for parsers (
name,spec) is tied to theParser<Input>trait. This info never varies depending on the the input type, so when there are multipleParser<Input>impls, we end up with duplicate impls and ambiguity requiring calls like this:Parser::<&str>::name(self)rather thanself.name().A better impl would be to split them out into a single
ParserInfotrait: