我正在关注
Rust By Example
我遇到了一个错误,我不知道该如何解决:
fn main() {
let x: f32 = 10.;
if (x == 10) {
println!("if");
} else if (x > 10) && (x<-5) {
println!("else if");
} else {
println!("else");
}
}
下面的编译错误可能是
else if
. 如何在中执行两个条件检查
否则,如果
为什么它不起作用?
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) {
| ^^^^