From ad9f2bf5df32e800113d0952211535f6798d522d Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 8 Sep 2021 23:09:02 +0530 Subject: Rust: Lucian's Luscious Lasagna: Format code, global constants --- rust/lucians-luscious-lasagna/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rust') diff --git a/rust/lucians-luscious-lasagna/src/lib.rs b/rust/lucians-luscious-lasagna/src/lib.rs index 06ea99a..9b7ae79 100644 --- a/rust/lucians-luscious-lasagna/src/lib.rs +++ b/rust/lucians-luscious-lasagna/src/lib.rs @@ -1,5 +1,7 @@ +const EXPECTED_TIME: i32 = 40; +const TIME_REQUIRED_FOR_A_LAYER: i32 = 2; + pub fn expected_minutes_in_oven() -> i32 { - const EXPECTED_TIME: i32 = 40; EXPECTED_TIME } @@ -8,11 +10,9 @@ pub fn remaining_minutes_in_oven(actual_minutes_in_oven: i32) -> i32 { } pub fn preparation_time_in_minutes(number_of_layers: i32) -> i32 { - 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, - actual_minutes_in_oven: i32) -> i32 { +pub fn elapsed_time_in_minutes(number_of_layers: i32, actual_minutes_in_oven: i32) -> i32 { preparation_time_in_minutes(number_of_layers) + actual_minutes_in_oven } -- cgit 1.4.1-2-gfad0