Question 5
Will the following code compile?
enum Structs {
ThreeDimensions {
x: i32,
y: i32,
z: i32
},
Precise3D {
x: f32,
y: f32,
z: f32
}
}
fn main() {
let int_point = Structs::ThreeDimensions {
x: 27,
y: 68,
z: 91
};
let float_point = Structs::Precise3D {
x: 23.456,
y: 75.364,
z: 21.052
};
if let (Structs::ThreeDimensions { x: 27, .. },
Structs::Precise3D { z: 21.035, .. }) =
(int_point, float_point) {
println!("Match!")
} else {
println!("Mismatch!")
}
}