summaryrefslogtreecommitdiff
path: root/exercises/02_functions/functions5.rs
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/02_functions/functions5.rs')
-rw-r--r--exercises/02_functions/functions5.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/exercises/02_functions/functions5.rs b/exercises/02_functions/functions5.rs
index f1b63f4..34a2ac7 100644
--- a/exercises/02_functions/functions5.rs
+++ b/exercises/02_functions/functions5.rs
@@ -1,15 +1,9 @@
-// functions5.rs
-//
-// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a
-// hint.
-
-// I AM NOT DONE
+// TODO: Fix the function body without changing the signature.
+fn square(num: i32) -> i32 {
+ num * num;
+}
fn main() {
let answer = square(3);
- println!("The square of 3 is {}", answer);
-}
-
-fn square(num: i32) -> i32 {
- num * num;
+ println!("The square of 3 is {answer}");
}