fix: ✏️ typos and compiler warnings
This commit is contained in:
parent
82c2fb8883
commit
528969944d
17 changed files with 578 additions and 632 deletions
|
@ -1,26 +1,22 @@
|
|||
fn main()
|
||||
{
|
||||
hello();
|
||||
fn main() {
|
||||
hello();
|
||||
|
||||
let x = {
|
||||
let y = 5; //Statement
|
||||
y+0 //Expression
|
||||
};
|
||||
println!("X = {}", x);
|
||||
let x = {
|
||||
let y = 5; //Statement
|
||||
y + 0 //Expression
|
||||
};
|
||||
println!("X = {}", x);
|
||||
|
||||
let y = return_value(x);
|
||||
println!("Y = {}", y)
|
||||
}
|
||||
|
||||
let y = return_value(x);
|
||||
println!("Y = {}", y)
|
||||
}
|
||||
fn hello() {
|
||||
println!("Hello World");
|
||||
}
|
||||
|
||||
fn hello()
|
||||
{
|
||||
println!("Hello World");
|
||||
}
|
||||
|
||||
fn return_value(mut x:i32) -> i32
|
||||
{
|
||||
println!("We're going to return something");
|
||||
x = x+1;
|
||||
x*x
|
||||
}
|
||||
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