mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-27 16:25:43 +02:00
Add division example to expression exercise (#2605)
This commit is contained in:
parent
8f01344757
commit
afe206beab
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user