From 541096f04729909a5bed0e837a5d3726e2adbfb2 Mon Sep 17 00:00:00 2001 From: Andinus Date: Tue, 7 Sep 2021 21:23:36 +0530 Subject: Rust: Lucian's Luscious Lasagna: Use implicit return --- rust/lucians-luscious-lasagna/src/lib.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'rust/lucians-luscious-lasagna') diff --git a/rust/lucians-luscious-lasagna/src/lib.rs b/rust/lucians-luscious-lasagna/src/lib.rs index 0028195..19da8d3 100644 --- a/rust/lucians-luscious-lasagna/src/lib.rs +++ b/rust/lucians-luscious-lasagna/src/lib.rs @@ -1,17 +1,14 @@ -pub fn expected_minutes_in_oven() -> i32 { - return 40; -} +pub fn expected_minutes_in_oven() -> i32 { 40 } pub fn remaining_minutes_in_oven(actual_minutes_in_oven: i32) -> i32 { - return expected_minutes_in_oven() - actual_minutes_in_oven; + expected_minutes_in_oven() - actual_minutes_in_oven } pub fn preparation_time_in_minutes(number_of_layers: i32) -> i32 { - return number_of_layers * 2; + number_of_layers * 2 } pub fn elapsed_time_in_minutes(number_of_layers: i32, actual_minutes_in_oven: i32) -> i32 { - return preparation_time_in_minutes(number_of_layers) - + actual_minutes_in_oven; + preparation_time_in_minutes(number_of_layers) + actual_minutes_in_oven } -- cgit 1.4.1-2-gfad0