Assign from a block

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

@ -1,10 +1,8 @@
fn main() {
println!("Hello, world!");
let y = {
let x = 3;
x + 1
};
another_function(5, 6);
}
fn another_function(x: i32, y: i32) {
println!("The value of x is: {}", x);
println!("The value of y is: {}", y);
}

Loading…
Cancel
Save