mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
replace use of fold_many0 with many0
in nom 8, `many0` doesn't accumulate when used within `recognize`
This commit is contained in:
parent
001aea4eca
commit
4b8f847cd8
1 changed files with 4 additions and 7 deletions
|
|
@ -14,7 +14,6 @@ use nom::combinator::recognize;
|
|||
use nom::combinator::rest;
|
||||
use nom::combinator::success;
|
||||
use nom::combinator::value;
|
||||
use nom::multi::fold_many0;
|
||||
use nom::multi::many0;
|
||||
use nom::sequence::delimited;
|
||||
use nom::sequence::pair;
|
||||
|
|
@ -179,12 +178,10 @@ fn tag_node(s: &str) -> IResult<Node> {
|
|||
name: &'name str,
|
||||
) -> impl FnMut(&'s str) -> IResult<'s, &'s str> + 'parser {
|
||||
move |s| {
|
||||
recognize(fold_many0(
|
||||
pair(not(closing_parser(name)), take_till_potential_tag_start),
|
||||
// we don't need to accumulate anything
|
||||
|| (),
|
||||
|_, _| (),
|
||||
))
|
||||
recognize(many0(pair(
|
||||
not(closing_parser(name)),
|
||||
take_till_potential_tag_start,
|
||||
)))
|
||||
.parse(s)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue