Shape Area
Define an enum called Shape with two variants:
Circle(f64)— holds the radiusRectangle(f64, f64)— holds the width and height
Create a variable set to Shape::Rectangle(4.0, 5.0) and use match to compute and print the area:
- Circle area =
3.14159 * radius * radius - Rectangle area =
width * height
Expected output:
Area: 20
rust
fn main() {
}