mirror of
https://github.com/rust-lang/book.git
synced 2026-05-17 01:33:39 -04:00
432 B
432 B
% if
There is a new edition of the book and this is an old link.
An
ifexpression allows us to branch our code depending on conditions.
fn main() {
let number = 3;
if number < 5 {
println!("condition was true");
} else {
println!("condition was false");
}
}
You can find the latest version of this information here.