From 2ff14448863ac1a1dd9533461708e29aae170c2d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:31 +0200 Subject: Adding debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- vendor/pest/tests/calculator.rs | 18 +++++----- vendor/pest/tests/json.rs | 75 ++++++++++++++++++++--------------------- 2 files changed, 45 insertions(+), 48 deletions(-) (limited to 'vendor/pest/tests') diff --git a/vendor/pest/tests/calculator.rs b/vendor/pest/tests/calculator.rs index b78ee0d27..54a50cc67 100644 --- a/vendor/pest/tests/calculator.rs +++ b/vendor/pest/tests/calculator.rs @@ -40,12 +40,12 @@ impl Parser for CalculatorParser { s.repeat(|s| { s.sequence(|s| { plus(s) - .or_else(|s| minus(s)) - .or_else(|s| times(s)) - .or_else(|s| divide(s)) - .or_else(|s| modulus(s)) - .or_else(|s| power(s)) - .and_then(|s| primary(s)) + .or_else(minus) + .or_else(times) + .or_else(divide) + .or_else(modulus) + .or_else(power) + .and_then(primary) }) }) }) @@ -57,10 +57,10 @@ impl Parser for CalculatorParser { state .sequence(|s| { s.match_string("(") - .and_then(|s| expression(s)) + .and_then(expression) .and_then(|s| s.match_string(")")) }) - .or_else(|s| number(s)) + .or_else(number) } fn number(state: Box>) -> ParseResult>> { @@ -109,7 +109,7 @@ impl Parser for CalculatorParser { } } -fn consume<'i>(pair: Pair<'i, Rule>, climber: &PrecClimber) -> i32 { +fn consume(pair: Pair, climber: &PrecClimber) -> i32 { let primary = |pair| consume(pair, climber); let infix = |lhs: i32, op: Pair, rhs: i32| match op.as_rule() { Rule::plus => lhs + rhs, diff --git a/vendor/pest/tests/json.rs b/vendor/pest/tests/json.rs index 84906258a..b9338c342 100644 --- a/vendor/pest/tests/json.rs +++ b/vendor/pest/tests/json.rs @@ -47,16 +47,16 @@ impl Parser for JsonParser { state.rule(Rule::object, |s| { s.sequence(|s| { s.match_string("{") - .and_then(|s| skip(s)) - .and_then(|s| pair(s)) - .and_then(|s| skip(s)) + .and_then(skip) + .and_then(pair) + .and_then(skip) .and_then(|s| { s.repeat(|s| { s.sequence(|s| { s.match_string(",") - .and_then(|s| skip(s)) - .and_then(|s| pair(s)) - .and_then(|s| skip(s)) + .and_then(skip) + .and_then(pair) + .and_then(skip) }) }) }) @@ -65,7 +65,7 @@ impl Parser for JsonParser { .or_else(|s| { s.sequence(|s| { s.match_string("{") - .and_then(|s| skip(s)) + .and_then(skip) .and_then(|s| s.match_string("}")) }) }) @@ -76,10 +76,10 @@ impl Parser for JsonParser { state.rule(Rule::pair, |s| { s.sequence(|s| { string(s) - .and_then(|s| skip(s)) + .and_then(skip) .and_then(|s| s.match_string(":")) - .and_then(|s| skip(s)) - .and_then(|s| value(s)) + .and_then(skip) + .and_then(value) }) }) } @@ -88,16 +88,16 @@ impl Parser for JsonParser { state.rule(Rule::array, |s| { s.sequence(|s| { s.match_string("[") - .and_then(|s| skip(s)) - .and_then(|s| value(s)) - .and_then(|s| skip(s)) + .and_then(skip) + .and_then(value) + .and_then(skip) .and_then(|s| { s.repeat(|s| { s.sequence(|s| { s.match_string(",") - .and_then(|s| skip(s)) - .and_then(|s| value(s)) - .and_then(|s| skip(s)) + .and_then(skip) + .and_then(value) + .and_then(skip) }) }) }) @@ -106,7 +106,7 @@ impl Parser for JsonParser { .or_else(|s| { s.sequence(|s| { s.match_string("[") - .and_then(|s| skip(s)) + .and_then(skip) .and_then(|s| s.match_string("]")) }) }) @@ -116,11 +116,11 @@ impl Parser for JsonParser { fn value(state: Box>) -> ParseResult>> { state.rule(Rule::value, |s| { string(s) - .or_else(|s| number(s)) - .or_else(|s| object(s)) - .or_else(|s| array(s)) - .or_else(|s| bool(s)) - .or_else(|s| null(s)) + .or_else(number) + .or_else(object) + .or_else(array) + .or_else(bool) + .or_else(null) }) } @@ -154,7 +154,7 @@ impl Parser for JsonParser { .or_else(|s| s.match_string("n")) .or_else(|s| s.match_string("r")) .or_else(|s| s.match_string("t")) - .or_else(|s| unicode(s)) + .or_else(unicode) }) }) } @@ -162,9 +162,9 @@ impl Parser for JsonParser { fn unicode(state: Box>) -> ParseResult>> { state.sequence(|s| { s.match_string("u") - .and_then(|s| hex(s)) - .and_then(|s| hex(s)) - .and_then(|s| hex(s)) + .and_then(hex) + .and_then(hex) + .and_then(hex) }) } @@ -179,15 +179,15 @@ impl Parser for JsonParser { state.rule(Rule::number, |s| { s.sequence(|s| { s.optional(|s| s.match_string("-")) - .and_then(|s| int(s)) + .and_then(int) .and_then(|s| { s.optional(|s| { s.sequence(|s| { s.match_string(".") .and_then(|s| s.match_range('0'..'9')) .and_then(|s| s.repeat(|s| s.match_range('0'..'9'))) - .and_then(|s| s.optional(|s| exp(s))) - .or_else(|s| exp(s)) + .and_then(|s| s.optional(exp)) + .or_else(exp) }) }) }) @@ -211,7 +211,7 @@ impl Parser for JsonParser { .and_then(|s| { s.optional(|s| s.match_string("+").or_else(|s| s.match_string("-"))) }) - .and_then(|s| int(s)) + .and_then(int) }) } @@ -451,15 +451,12 @@ fn ast() { .unwrap(), ); - match ast { - Json::Object(pairs) => { - let vals: Vec<&Json> = pairs.values().collect(); + if let Json::Object(pairs) = ast { + let vals: Vec<&Json> = pairs.values().collect(); - assert_eq!( - **vals.get(0).unwrap(), - Json::Array(vec![Json::Null, Json::Bool(true), Json::Number(3.4)]) - ); - } - _ => {} + assert_eq!( + **vals.get(0).unwrap(), + Json::Array(vec![Json::Null, Json::Bool(true), Json::Number(3.4)]) + ); } } -- cgit v1.2.3