>>109621527
enum Shape {
Circle { radius: f64 },
Rectangle { width: f64, height: f64 },
Point,
}
fn process_shape(shape: &Shape) {
match shape {
Shape::Circle { radius } => println!("Circle radius: {radius}"),
Shape::Rectangle { width, height } => println!("Rectangle area: {}", width * height),
Shape::Point => println!("Point has no area"),
}
}
I know which one I'd rather look at.