Init from a func return value

cat-town
Dan Buch 6 years ago
parent 093698d6d2
commit 17566db003
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

@ -1,8 +1,9 @@
fn five() -> i32 {
5
}
fn main() {
let y = {
let x = 3;
x + 1
};
let x = five();
println!("The value of y is: {}", y);
println!("The value of x is: {}", x);
}

Loading…
Cancel
Save