Init from func return with params

This commit is contained in:
Dan Buch
2017-12-22 09:10:20 -05:00
parent 17566db003
commit 9136ef39c4

View File

@@ -1,9 +1,9 @@
fn five() -> i32 {
5
}
fn main() { fn main() {
let x = five(); let x = plus_one(5);
println!("The value of x is: {}", x); println!("The value of x is: {}", x);
} }
fn plus_one(x: i32) -> i32 {
x + 1
}