From a8d6f332a8f2399446264e84aea302d8d5f3e0d9 Mon Sep 17 00:00:00 2001 From: Simon Benezan Date: Fri, 26 Apr 2024 03:37:21 +0200 Subject: [PATCH] move format_time_delta to own file --- crunchy-cli-core/src/utils/fmt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crunchy-cli-core/src/utils/fmt.rs b/crunchy-cli-core/src/utils/fmt.rs index 89eafc2..cd7d81a 100644 --- a/crunchy-cli-core/src/utils/fmt.rs +++ b/crunchy-cli-core/src/utils/fmt.rs @@ -1,7 +1,7 @@ use chrono::TimeDelta; pub fn format_time_delta(time_delta: &TimeDelta) -> String { - let negative: bool = time_delta.abs() > *time_delta; + let negative = *time_delta < TimeDelta::zero(); let time_delta = time_delta.abs(); let hours = time_delta.num_hours(); let minutes = time_delta.num_minutes() - time_delta.num_hours() * 60;