Skip to content

Commit

Permalink
Simpler negative val check
Browse files Browse the repository at this point in the history
Co-authored-by: David Hewitt <david@hewitt.tech>
  • Loading branch information
sydney-runkle and davidhewitt committed Mar 12, 2024
1 parent d2b354a commit a250007
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl fmt::Display for Time {
let hours = total_minutes / 60;
let minutes = total_minutes % 60;
let mut buf: [u8; 6] = *b"+00:00";
if (minutes < 0) || (hours < 0) {
if tz_offset < 0 {
buf[0] = b'-';
}
crate::display_num_buf(2, 1, hours.unsigned_abs(), &mut buf);
Expand Down

0 comments on commit a250007

Please sign in to comment.