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