Flatten nested Rust projects into monorepo

This commit is contained in:
2025-07-01 10:51:25 +03:00
commit 1170ebe04d
29 changed files with 557 additions and 0 deletions

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 = 4
[[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 = "2024"
[dependencies]

65
loops/src/main.rs Normal file
View File

@@ -0,0 +1,65 @@
fn main() {
let mut counter = 0;
let result = loop {
counter += 1;
if counter == 10 {
break counter * 6;
}
};
println!("Result is: {result}");
let mut count = 0;
'inner_loop: loop {
println!("Counter: {count}");
let mut remaining = 10;
loop {
println!("Remain: {remaining}");
if remaining == 9 {
break;
}
if count == 2 {
break 'inner_loop;
}
remaining -= 1;
}
count += 1;
}
println!("End of counter: {count}");
let mut number = 3;
while number != 0 {
println!("{number}!");
number -= 1;
}
println!("LIFTOFF!!!");
let a = [10, 20, 30, 40, 50];
let mut index = 0;
while index < 5 {
println!("the value is: {}", a[index]);
index += 1;
}
for element in a {
println!("the value is: {element}");
} // this is better and safer usecase for listing elements of an array
for number in (1..4).rev() {
println!("{number}!");
}
println!("LIFTOFF!!!");
}