Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 468 Bytes

Conditionals.md

File metadata and controls

21 lines (15 loc) · 468 Bytes

Conditionals

Unchained conditionals are not allowed in Rust for reasons of unnecessary complexity in the compiler. Values ​​like this 123 == 123 == 123 are not allowed; instead, it should be 123 == 123 && 123 == 123.

fn main() {

    // NOTE: Unchained conditions aren't allowed, as Rust.

    var allowed: bool = 123 == 122;

    if allowed {
        ...
    } elif allowed == false && 12 == 12 {
        ...
    } else {
        ...
    }

}