struct Point {
x: f64,
y: f64,
}
enum Shape {
Circle(Point, f64),
Rectangle(Point, Point),
}
let my_shape = Shape::Circle(Point { x: 0.0, y: 0.0 }, 10.0);
Run Code Online (Sandbox Code Playgroud)
我想打印出circle
第二个属性,这里是10.0.我试过my_shape.last
和my_shape.second
,但既不工作.
在这种情况下,我该怎么办才能打印10.0?
rust ×1