Skip to content

Commit

Permalink
style: no need to specify the input type in the fold closure
Browse files Browse the repository at this point in the history
  • Loading branch information
39555 committed Nov 22, 2024
1 parent 431b6f6 commit 482a162
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/combinator/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,17 +314,17 @@ mod tests {
use Infix::*;
expression(0, digit1.parse_to::<i32>())
.prefix(dispatch! {any;
'+' => Prefix(12, |_: &mut _, a: i32| Ok(a)),
'-' => Prefix(12, |_: &mut _, a: i32| Ok(-a)),
'+' => Prefix(12, |_, a| Ok(a)),
'-' => Prefix(12, |_, a: i32| Ok(-a)),
_ => fail
})
.infix(dispatch! {any;
'+' => Left(5, |_: &mut _, a, b| Ok(a + b)),
'-' => Left(5, |_: &mut _, a, b| Ok(a - b)),
'*' => Left(7, |_: &mut _, a, b| Ok(a * b)),
'/' => Left(7, |_: &mut _, a, b| Ok(a / b)),
'%' => Left(7, |_: &mut _, a, b| Ok(a % b)),
'^' => Left(9, |_: &mut _, a, b| Ok(a ^ b)),
'+' => Left(5, |_, a, b| Ok(a + b)),
'-' => Left(5, |_, a, b| Ok(a - b)),
'*' => Left(7, |_, a, b| Ok(a * b)),
'/' => Left(7, |_, a, b| Ok(a / b)),
'%' => Left(7, |_, a, b| Ok(a % b)),
'^' => Left(9, |_, a, b| Ok(a ^ b)),
_ => fail
})
.parse_next(i)
Expand Down

0 comments on commit 482a162

Please sign in to comment.