Init commit
This commit is contained in:
2
functions/.gitignore
vendored
Normal file
2
functions/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/target
|
||||
**/*.rs.bk
|
4
functions/Cargo.lock
generated
Normal file
4
functions/Cargo.lock
generated
Normal file
@ -0,0 +1,4 @@
|
||||
[[package]]
|
||||
name = "functions"
|
||||
version = "0.1.0"
|
||||
|
7
functions/Cargo.toml
Normal file
7
functions/Cargo.toml
Normal file
@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "functions"
|
||||
version = "0.1.0"
|
||||
authors = ["mollusk <silvernode@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
30
functions/src/main.rs
Normal file
30
functions/src/main.rs
Normal file
@ -0,0 +1,30 @@
|
||||
fn main() {
|
||||
|
||||
println!("Function 1\n");
|
||||
another_function(5, 6);
|
||||
|
||||
let x = five();
|
||||
|
||||
println!("Function 2\n");
|
||||
println!("The value of x is: {}\n", x);
|
||||
|
||||
let x = plus_one(5);
|
||||
|
||||
println!("Function 3\n");
|
||||
|
||||
println!("The value of x is {}: ", x);
|
||||
}
|
||||
|
||||
|
||||
fn another_function(x: i32, y: i32) {
|
||||
println!("The value of x is: {}", x);
|
||||
println!("The value of y is: {}\n", y);
|
||||
}
|
||||
|
||||
fn five() -> i32 {
|
||||
5
|
||||
}
|
||||
|
||||
fn plus_one(x: i32) -> i32 {
|
||||
x + 1
|
||||
}
|
Reference in New Issue
Block a user