From f6cbf2bf76e77c8f64312f573f46cdc7bd434acd Mon Sep 17 00:00:00 2001 From: hybrid Date: Sat, 3 Oct 2026 04:40:21 +0300 Subject: add: 8 projects variables, shadowing, another_function, branches, loops, fahr2cel, fibonacci, christmax_song --- src/another_function/Cargo.toml | 6 ++++++ src/another_function/src/main.rs | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/another_function/Cargo.toml create mode 100644 src/another_function/src/main.rs (limited to 'src/another_function') diff --git a/src/another_function/Cargo.toml b/src/another_function/Cargo.toml new file mode 100644 index 0000000..7d60c8a --- /dev/null +++ b/src/another_function/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "another_function" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/src/another_function/src/main.rs b/src/another_function/src/main.rs new file mode 100644 index 0000000..9da0175 --- /dev/null +++ b/src/another_function/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + println!("First argument is: {}", print_labeled_measurement(5, 'h')); +} + +fn print_labeled_measurement(value: i32, unit_label: char) -> i32 { + println!("The measurement is: {value}{unit_label}"); + value +} -- cgit v1.3.1