$ 0 0 Use an if statement:if some_boolean { 1 } else { 0 }See also:How can I port C++ code that uses the ternary operator to Rust?