From 7250f5077ab8a024debcced8b28bc20558932716 Mon Sep 17 00:00:00 2001 From: "stephan.klauberg" Date: Sat, 23 Sep 2023 18:05:06 +0200 Subject: [PATCH] fuctions done --- exercises/functions/functions2.rs | 2 +- exercises/functions/functions3.rs | 4 ++-- exercises/functions/functions4.rs | 4 ++-- exercises/functions/functions5.rs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/functions/functions2.rs b/exercises/functions/functions2.rs index 206f783a..d2d848aa 100644 --- a/exercises/functions/functions2.rs +++ b/exercises/functions/functions2.rs @@ -3,7 +3,7 @@ // Execute `rustlings hint functions2` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE +// I AM DONE fn main() { call_me(3); diff --git a/exercises/functions/functions3.rs b/exercises/functions/functions3.rs index 74f44d6d..429d7651 100644 --- a/exercises/functions/functions3.rs +++ b/exercises/functions/functions3.rs @@ -3,10 +3,10 @@ // Execute `rustlings hint functions3` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE +// I AM DONE fn main() { - call_me(); + call_me(2); } fn call_me(num: u32) { diff --git a/exercises/functions/functions4.rs b/exercises/functions/functions4.rs index 77c4b2aa..ab1239a1 100644 --- a/exercises/functions/functions4.rs +++ b/exercises/functions/functions4.rs @@ -8,14 +8,14 @@ // Execute `rustlings hint functions4` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE +// I AM DONE fn main() { let original_price = 51; println!("Your sale price is {}", sale_price(original_price)); } -fn sale_price(price: i32) -> { +fn sale_price(price: i32) -> i32 { if is_even(price) { price - 10 } else { diff --git a/exercises/functions/functions5.rs b/exercises/functions/functions5.rs index f1b63f48..38ed6f1f 100644 --- a/exercises/functions/functions5.rs +++ b/exercises/functions/functions5.rs @@ -3,7 +3,7 @@ // Execute `rustlings hint functions5` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE +// I AM DONE fn main() { let answer = square(3); @@ -11,5 +11,5 @@ fn main() { } fn square(num: i32) -> i32 { - num * num; + num * num }