Flatten nested Rust projects into monorepo
This commit is contained in:
7
branches/Cargo.lock
generated
Normal file
7
branches/Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "branches"
|
||||
version = "0.1.0"
|
6
branches/Cargo.toml
Normal file
6
branches/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "branches"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
20
branches/src/main.rs
Normal file
20
branches/src/main.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
fn main() {
|
||||
let condition = true;
|
||||
let result = if condition { 5 } else { 6 };
|
||||
// let result = if condition { 5 } else { 'six' };
|
||||
// will throw an error, should be the same type
|
||||
|
||||
println!("The result is {result}");
|
||||
|
||||
let number = 6;
|
||||
|
||||
if number % 4 == 0 {
|
||||
println!("number is divisible by 4");
|
||||
} else if number % 3 == 0 {
|
||||
println!("number is divisible by 3");
|
||||
} else if number % 2 == 0 {
|
||||
println!("number is divisible by 2");
|
||||
} else {
|
||||
println!("number is not divisible by 4, 3, or 2");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user