Assign from condition

This commit is contained in:
Dan Buch 2017-12-22 10:27:43 -05:00
parent 462d440f1f
commit 03914257e0
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

View File

@ -1,9 +1,10 @@
fn main() {
let number = 3;
if number < 5 {
println!("condition was true");
let condition = true;
let number = if condition {
5
} else {
println!("condition was false");
}
6
};
println!("The value of number is: {}", number);
}