Flatten nested Rust projects into monorepo
This commit is contained in:
7
functions/Cargo.lock
generated
Normal file
7
functions/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 = "functions"
|
||||
version = "0.1.0"
|
6
functions/Cargo.toml
Normal file
6
functions/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "functions"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
32
functions/src/main.rs
Normal file
32
functions/src/main.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
fn main() {
|
||||
another(10);
|
||||
measure(10, 'm');
|
||||
|
||||
let a = numba();
|
||||
println!("Value of a: {a}");
|
||||
|
||||
let x = {
|
||||
let y = 3;
|
||||
y + 2 // returns a Value
|
||||
// but:
|
||||
// let x = {
|
||||
// let y = 3;
|
||||
// y + 2;
|
||||
// };
|
||||
// just a statement, doesnt return any value
|
||||
}; // This is an expression
|
||||
|
||||
println!("Value of x: {x}");
|
||||
}
|
||||
|
||||
fn another(x: u32) {
|
||||
println!("{x}");
|
||||
}
|
||||
|
||||
fn measure(height: i32, unit: char) {
|
||||
println!("Measuring... {height}{unit}.");
|
||||
}
|
||||
|
||||
fn numba() -> i32 {
|
||||
69
|
||||
}
|
Reference in New Issue
Block a user