Add new projects

This commit is contained in:
NullBite 2023-10-01 20:35:50 -04:00
parent e6bc4ef483
commit f28d70b9b8
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
6 changed files with 52 additions and 0 deletions

7
functions/Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "functions"
version = "0.1.0"

8
functions/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "functions"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

11
functions/src/main.rs Normal file
View File

@ -0,0 +1,11 @@
fn main() {
print_labeled_measurement(37, 'h');
}
fn another_function(x: i32) {
println!("The value of x is: {x}");
}
fn print_labeled_measurement(value: i32, unit_label: char) {
println!("The measurement is: {value}{unit_label}");
}

7
variables/Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "variables"
version = "0.1.0"

8
variables/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "variables"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

11
variables/src/main.rs Normal file
View File

@ -0,0 +1,11 @@
fn main() {
let x = 5;
let x = x + 1;
{
let x=x*2;
println!("The value of x in the inner scope is: {x}");
}
println!("The value of x is: {x}");
}