diff options
Diffstat (limited to '')
-rw-r--r-- | vendor/pest/tests/json.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/vendor/pest/tests/json.rs b/vendor/pest/tests/json.rs index b9338c342..b66f39df7 100644 --- a/vendor/pest/tests/json.rs +++ b/vendor/pest/tests/json.rs @@ -39,11 +39,11 @@ struct JsonParser; impl Parser<Rule> for JsonParser { fn parse(rule: Rule, input: &str) -> Result<Pairs<Rule>, Error<Rule>> { - fn json(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn json(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { value(state) } - fn object(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn object(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::object, |s| { s.sequence(|s| { s.match_string("{") @@ -72,7 +72,7 @@ impl Parser<Rule> for JsonParser { }) } - fn pair(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn pair(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::pair, |s| { s.sequence(|s| { string(s) @@ -84,7 +84,7 @@ impl Parser<Rule> for JsonParser { }) } - fn array(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn array(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::array, |s| { s.sequence(|s| { s.match_string("[") @@ -113,7 +113,7 @@ impl Parser<Rule> for JsonParser { }) } - fn value(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn value(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::value, |s| { string(s) .or_else(number) @@ -124,7 +124,7 @@ impl Parser<Rule> for JsonParser { }) } - fn string(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn string(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::string, |s| { s.match_string("\"") .and_then(|s| { @@ -143,7 +143,7 @@ impl Parser<Rule> for JsonParser { }) } - fn escape(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn escape(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.sequence(|s| { s.match_string("\\").and_then(|s| { s.match_string("\"") @@ -159,7 +159,7 @@ impl Parser<Rule> for JsonParser { }) } - fn unicode(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn unicode(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.sequence(|s| { s.match_string("u") .and_then(hex) @@ -168,14 +168,14 @@ impl Parser<Rule> for JsonParser { }) } - fn hex(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn hex(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state .match_range('0'..'9') .or_else(|s| s.match_range('a'..'f')) .or_else(|s| s.match_range('A'..'F')) } - fn number(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn number(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::number, |s| { s.sequence(|s| { s.optional(|s| s.match_string("-")) @@ -195,7 +195,7 @@ impl Parser<Rule> for JsonParser { }) } - fn int(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn int(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.match_string("0").or_else(|s| { s.sequence(|s| { s.match_range('1'..'9') @@ -204,7 +204,7 @@ impl Parser<Rule> for JsonParser { }) } - fn exp(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn exp(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.sequence(|s| { s.match_string("E") .or_else(|s| s.match_string("e")) @@ -215,17 +215,17 @@ impl Parser<Rule> for JsonParser { }) } - fn bool(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn bool(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::bool, |s| { s.match_string("true").or_else(|s| s.match_string("false")) }) } - fn null(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn null(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.rule(Rule::null, |s| s.match_string("null")) } - fn skip(state: Box<ParserState<Rule>>) -> ParseResult<Box<ParserState<Rule>>> { + fn skip(state: Box<ParserState<'_, Rule>>) -> ParseResult<Box<ParserState<'_, Rule>>> { state.repeat(|s| { s.match_string(" ") .or_else(|s| s.match_string("\t")) |