renaming, nothing fancy
This commit is contained in:
parent
4c8ea45113
commit
a1828f53eb
18 changed files with 0 additions and 0 deletions
26
05-functions/src/main.rs
Normal file
26
05-functions/src/main.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
fn main()
|
||||
{
|
||||
hello();
|
||||
|
||||
let x = {
|
||||
let y = 5; //Statement
|
||||
y+0 //Expression
|
||||
};
|
||||
println!("X = {}", x);
|
||||
|
||||
|
||||
let y = return_value(x);
|
||||
println!("Y = {}", y)
|
||||
}
|
||||
|
||||
fn hello()
|
||||
{
|
||||
println!("Hello World");
|
||||
}
|
||||
|
||||
fn return_value(mut x:i32) -> i32
|
||||
{
|
||||
println!("We're going to return something");
|
||||
x = x+1;
|
||||
x*x
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue