Remove some uses of closures in test

This commit is contained in:
Greg Shuflin 2023-02-25 02:50:20 -08:00
parent 116e2fc361
commit f15488194c
1 changed files with 7 additions and 2 deletions

View File

@ -61,8 +61,13 @@ fn json_bool<'a>() -> impl JsonParser<'a, JsonValue> {
}
fn json_number<'a>() -> impl JsonParser<'a, JsonValue> {
let digit = || one_of("1234567890");
let digits = || repeated(digit()).at_least(1);
fn digit<'a>() -> impl JsonParser<'a, &'a str> {
one_of("1234567890")
}
fn digits<'a>() -> impl JsonParser<'a, Vec<&'a str>> {
repeated(digit()).at_least(1)
}
let json_number_inner = choice((
seq((digits(), literal(".").ignore_then(digits()).optional())).map(