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