summaryrefslogtreecommitdiffstats
path: root/vendor/winnow/examples/json/parser_partial.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/winnow/examples/json/parser_partial.rs')
-rw-r--r--vendor/winnow/examples/json/parser_partial.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/winnow/examples/json/parser_partial.rs b/vendor/winnow/examples/json/parser_partial.rs
index 8050de4b7..4b6d143f9 100644
--- a/vendor/winnow/examples/json/parser_partial.rs
+++ b/vendor/winnow/examples/json/parser_partial.rs
@@ -3,14 +3,14 @@ use std::str;
use winnow::prelude::*;
use winnow::{
- branch::alt,
- bytes::{any, none_of, take, take_while0},
- character::float,
+ ascii::float,
+ combinator::alt,
combinator::{cut_err, rest},
+ combinator::{delimited, preceded, separated_pair, terminated},
+ combinator::{fold_repeat, separated0},
error::{ContextError, ParseError},
- multi::{fold_many0, separated0},
- sequence::{delimited, preceded, separated_pair, terminated},
stream::Partial,
+ token::{any, none_of, take, take_while},
};
use crate::json::JsonValue;
@@ -88,7 +88,7 @@ fn string<'i, E: ParseError<Stream<'i>> + ContextError<Stream<'i>, &'static str>
// right branch (since we found the `"` character) but encountered an error when
// parsing the string
cut_err(terminated(
- fold_many0(character, String::new, |mut string, c| {
+ fold_repeat(0.., character, String::new, |mut string, c| {
string.push(c);
string
}),
@@ -192,9 +192,9 @@ fn key_value<'i, E: ParseError<Stream<'i>> + ContextError<Stream<'i>, &'static s
/// first we write parsers for the smallest elements (here a space character),
/// then we'll combine them in larger parsers
fn ws<'i, E: ParseError<Stream<'i>>>(input: Stream<'i>) -> IResult<Stream<'i>, &'i str, E> {
- // Combinators like `take_while0` return a function. That function is the
+ // Combinators like `take_while` return a function. That function is the
// parser,to which we can pass the input
- take_while0(WS).parse_next(input)
+ take_while(0.., WS).parse_next(input)
}
fn ws_or_eof<'i, E: ParseError<Stream<'i>>>(input: Stream<'i>) -> IResult<Stream<'i>, &'i str, E> {