Skip to content

Commit

Permalink
Add division example to expression exercise (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison authored Feb 6, 2025
1 parent 8f01344 commit afe206b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pattern-matching/exercise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ fn test_zeros() {

fn main() {
let expr = Expression::Op {
op: Operation::Sub,
left: Box::new(Expression::Value(20)),
right: Box::new(Expression::Value(10)),
op: Operation::Div,
left: Box::new(Expression::Value(10)),
right: Box::new(Expression::Value(2)),
};
println!("expr: {expr:?}");
println!("result: {:?}", eval(expr));
Expand Down

0 comments on commit afe206b

Please sign in to comment.