diff --git a/src/choice/mod.rs b/src/choice/mod.rs index f3ff6a3..8f0e7d5 100644 --- a/src/choice/mod.rs +++ b/src/choice/mod.rs @@ -7,10 +7,7 @@ where P2: Parser, I: ParserInput + Clone, { - move |input: I| match parser1.parse(input.clone()) { - ok @ Ok(..) => ok, - Err(_e) => parser2.parse(input), - } + choice((parser1, parser2)) } pub fn choice(choices: C) -> (impl Parser, Bnf)