1
0
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:
Nicole L 2025-02-05 16:11:42 -08:00 committed by GitHub
parent 8f01344757
commit afe206beab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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));