From 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:03:36 +0200 Subject: Adding upstream version 1.65.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/pest/tests/calculator.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vendor/pest/tests/calculator.rs') 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, -- cgit v1.2.3