diff --git a/tests/json_parser.rs b/tests/json_parser.rs index fc20614..da3f391 100644 --- a/tests/json_parser.rs +++ b/tests/json_parser.rs @@ -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(