nushell/.github
Devyn Cairns 13160b3ec3
Replace subtraction of Instants and Durations with saturating subtractions (#12549)
# Description
Duration can not be negative, and an underflow causes a panic.

This should fix #12539 as from what I can tell that bug was caused in
`nu-explore:📟:events` from subtracting durations, but I figured
this might be more widespread, and saturating to zero generally makes
sense.

I also added the relevant clippy lint to try to prevent this from
happening in the future. I can't think of a reason we would ever want to
subtract durations without checking first.

cc @fdncred

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
2024-04-17 07:25:16 -05:00
..
AUTO_ISSUE_TEMPLATE Move the nightly issue template to a hidden place (#9495) 2023-06-21 22:41:57 +08:00
ISSUE_TEMPLATE Remove the rarely used std-lib issue template (#12173) 2024-03-12 23:10:23 +01:00
workflows Replace subtraction of Instants and Durations with saturating subtractions (#12549) 2024-04-17 07:25:16 -05:00
dependabot.yml Reschedule dependabot PR opening to Wednesday (#12082) 2024-03-06 23:08:35 +01:00
pull_request_template.md Add notice to enable develop mode on Windows (#10111) 2023-08-24 11:02:54 -07:00