Conditions in Rust don't need parentheses around them, and they must evaluate strictly to a bool. Because if is an expression, you can assign its result directly to a let variable (replacing the ternary operator from other languages).
ADVERTISEMENT