From 3ea4a7cb1cc79ffb5f8c0063de000fcf40b6a763 Mon Sep 17 00:00:00 2001 From: Bearmine Date: Sun, 25 May 2025 19:36:45 -0500 Subject: [PATCH] Update function comment --- day_02/src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/day_02/src/main.rs b/day_02/src/main.rs index f381459..3686beb 100644 --- a/day_02/src/main.rs +++ b/day_02/src/main.rs @@ -39,11 +39,14 @@ struct LevelTransition { state: TransitionState, direction: TransitionDirection, } -/// Given two level inputs, return one of the following: -/// - `LevelTransitionState::Bad` if the difference between +/// Given two level inputs, return a LevelTransition of the state: +/// - `TransitionState::Bad` if the difference between /// the levels is either 0 or great than 3 -/// - `LevelTransitionState::Asc` if the value from curr_level to next_level is increasing and it's not BAD -/// - `LevelTransitionState::Desc` if the value from curr_level to next_level is decreasing and it's not BAD +/// - otherwise `TransitionState::Good` +/// +/// And direction: +/// - `TransitionDirection::Asc` if the value from curr_level to next_level is increasing +/// - `TransitionDirection::Desc` if the value from curr_level to next_level is decreasing fn compare_levels(curr_level: i64, next_level: i64) -> LevelTransition { let level_diff = next_level - curr_level;