Assign from a block

This commit is contained in:
Dan Buch 2017-12-22 09:03:06 -05:00
parent 44afa4b13c
commit 093698d6d2
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

View File

@ -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);
}