Init from a func return value
This commit is contained in:
parent
093698d6d2
commit
17566db003
@ -1,8 +1,9 @@
|
|||||||
fn main() {
|
fn five() -> i32 {
|
||||||
let y = {
|
5
|
||||||
let x = 3;
|
}
|
||||||
x + 1
|
|
||||||
};
|
fn main() {
|
||||||
|
let x = five();
|
||||||
println!("The value of y is: {}", y);
|
|
||||||
|
println!("The value of x is: {}", x);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user