Update function comment

This commit is contained in:
2025-05-25 19:36:45 -05:00
parent 45c5a7a1df
commit 3ea4a7cb1c

View File

@@ -39,11 +39,14 @@ struct LevelTransition {
state: TransitionState, state: TransitionState,
direction: TransitionDirection, direction: TransitionDirection,
} }
/// Given two level inputs, return one of the following: /// Given two level inputs, return a LevelTransition of the state:
/// - `LevelTransitionState::Bad` if the difference between /// - `TransitionState::Bad` if the difference between
/// the levels is either 0 or great than 3 /// 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 /// - otherwise `TransitionState::Good`
/// - `LevelTransitionState::Desc` if the value from curr_level to next_level is decreasing and it's not BAD ///
/// 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 { fn compare_levels(curr_level: i64, next_level: i64) -> LevelTransition {
let level_diff = next_level - curr_level; let level_diff = next_level - curr_level;