-
-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: Use i64 for internal unix timestamps
pendulum 3.0.0 fails to build on 32-bit armhf: ``` error: this arithmetic operation will overflow --> src/helpers.rs:59:20 | 59 | seconds += ((146_097 - 10957) * SECS_PER_DAY as usize) as isize; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `135140_usize * 86400_usize`, which would overflow | = note: `#[deny(arithmetic_overflow)]` on by default ``` `(146_097 - 10957) * SECS_PER_DAY` equals 11,676,096,000 which does not fit into 32 bit integers. Use i64 for the seconds variable while handling with the timestamp. Only convert in to `usize` once the timestamp is split into its components. Fixes #784 Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/pendulum/+bug/2079029
- Loading branch information
Showing
1 changed file
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters