summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-08 22:06:44 +0530
committerAndinus <andinus@nand.sh>2021-09-08 22:07:12 +0530
commit9d2c4e843ff1a4b311018a6ad15ddbd4944a712b (patch)
treeb5fc5514291dc1b35afd872470aa5512bf18d45d
parentec5a1924f4cff534e42a3b01a01ea29724a487f1 (diff)
downloadexercism-9d2c4e843ff1a4b311018a6ad15ddbd4944a712b.tar.gz
Rust: Lucian's Luscious Lasagna: No magic numbers
-rw-r--r--rust/lucians-luscious-lasagna/src/lib.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/rust/lucians-luscious-lasagna/src/lib.rs b/rust/lucians-luscious-lasagna/src/lib.rs
index 19da8d3..06ea99a 100644
--- a/rust/lucians-luscious-lasagna/src/lib.rs
+++ b/rust/lucians-luscious-lasagna/src/lib.rs
@@ -1,11 +1,15 @@
-pub fn expected_minutes_in_oven() -> i32 { 40 }
+pub fn expected_minutes_in_oven() -> i32 {
+    const EXPECTED_TIME: i32 = 40;
+    EXPECTED_TIME
+}
 
 pub fn remaining_minutes_in_oven(actual_minutes_in_oven: i32) -> i32 {
     expected_minutes_in_oven() - actual_minutes_in_oven
 }
 
 pub fn preparation_time_in_minutes(number_of_layers: i32) -> i32 {
-    number_of_layers * 2
+    const TIME_REQUIRED_FOR_A_LAYER: i32 = 2;
+    number_of_layers * TIME_REQUIRED_FOR_A_LAYER
 }
 
 pub fn elapsed_time_in_minutes(number_of_layers: i32,