Compare commits

..

12 commits

12 changed files with 80 additions and 0 deletions

7
branches/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 = "branches"
version = "0.1.0"

6
branches/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "branches"
version = "0.1.0"
edition = "2021"
[dependencies]

9
branches/src/main.rs Normal file
View file

@ -0,0 +1,9 @@
fn main() {
let number = 3;
if number < 5 {
println!("condition was true");
} else {
println!("condition was false");
}
}

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"

6
functions/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "functions"
version = "0.1.0"
edition = "2021"
[dependencies]

7
functions/src/main.rs Normal file
View file

@ -0,0 +1,7 @@
fn main() {
print_labeled_measurement(5, 'h');
}
fn print_labeled_measurement(value: i32, unit_label: char) {
println!("The measurement is: {value}{unit_label}");
}

7
loops/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 = "loops"
version = "0.1.0"

6
loops/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "loops"
version = "0.1.0"
edition = "2021"
[dependencies]

6
loops/src/main.rs Normal file
View file

@ -0,0 +1,6 @@
fn main() {
for number in (1..4).rev() {
println!("{number}!");
}
println!("LIFTOFF!!!");
}

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"

6
variables/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "variables"
version = "0.1.0"
edition = "2021"
[dependencies]

6
variables/src/main.rs Normal file
View file

@ -0,0 +1,6 @@
fn main() {
let mut x = 5;
println!("The value of x is: {x}");
x = 6;
println!("The value of x is: {x}");
}