Init commit

This commit is contained in:
2019-02-05 07:08:31 -07:00
commit ad9ebb8920
22 changed files with 329 additions and 0 deletions

2
functions/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
**/*.rs.bk

4
functions/Cargo.lock generated Normal file
View File

@ -0,0 +1,4 @@
[[package]]
name = "functions"
version = "0.1.0"

7
functions/Cargo.toml Normal file
View 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
View 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
}