I am following Rust By Example and am getting an error which I am not sure how to address:
fn main() {
let x: f32 = 10.;
if (x == 10) {
println!("if");
} else if (x > 10) && (x<-5) {
println!("else if");
} else {
println!("else");
}
}
The compiling error below looks to be as a results of the else if
. How do perform two conditional checks in the else if
and why is it not working?
error: placement-in expression syntax is experimental and subject to change. (see issue #27779)
--> src/main.rs:6:28
|
6 | } else if (x > 10) && (x<-5) {
| ^^^^