You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0034]: multiple applicable items in scope
--> src/test.rs:29:17
|
29 | base_parser.into().parse(input)
| ^^^^ multiple `into` found
|
= note: candidate #1 is defined in an impl of the trait `nom::Parser` for the type `F`
= note: candidate #2 is defined in an impl of the trait `std::convert::Into` for the type `T`
help: disambiguate the method for candidate #1
|
29 | nom::Parser::into(base_parser).parse(input)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
|
29 | std::convert::Into::into(base_parser).parse(input)
|
This error sounds correct and legit to me, and I've found the following workarounds:
I was wondering if the Parser::into(sub_parser) is the preferred form here?
I wanted to write my parser using chained parsers (parser1.then(parser2).and_then(parser3).or(parser4)) instead
of wrapped parsers (tuple(map(opt(…)))), but because of this error it seems that I will not be able to.
I think that renaming Parser::into to something else would solve it, but this may not be what you want.
Hi nom,
I'm writing a parser, and at some point I wanted to use the
Parser::into
method:However, this leads to the following error:
This error sounds correct and legit to me, and I've found the following workarounds:
I was wondering if the
Parser::into(sub_parser)
is the preferred form here?I wanted to write my parser using chained parsers (
parser1.then(parser2).and_then(parser3).or(parser4)
) insteadof wrapped parsers (
tuple(map(opt(…)))
), but because of this error it seems that I will not be able to.I think that renaming
Parser::into
to something else would solve it, but this may not be what you want.I'm using nom
8.0.0
with rust1.85.0
.The text was updated successfully, but these errors were encountered: