From 869e68986aa8f69af6e7842260a68d1e5c6f796f Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 10 Jul 2025 22:24:20 +0200 Subject: Add a bunch of code Signed-off-by: Carlos Maiolino --- rust/functions/src/main.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rust/functions/src/main.rs (limited to 'rust/functions/src/main.rs') diff --git a/rust/functions/src/main.rs b/rust/functions/src/main.rs new file mode 100644 index 0000000..d246d2c --- /dev/null +++ b/rust/functions/src/main.rs @@ -0,0 +1,19 @@ +fn main() { + println!("Hello, world!"); + another_function(5, 'Y'); + println!("FOO: {}", foo()); + println!("PlusOne: {}", plus_one(5)); +} + +fn another_function(x:i32, y:char) { + println!("The value of x is: {x} and y is: {y}"); +} + +// This kaboom +fn foo() -> i32 { + 3+5; +} + +fn plus_one(x: i32) -> i32 { + x + 1 +} -- cgit v1.2.3