Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix uses of Instant::sub #1457

Merged
merged 2 commits into from
Feb 1, 2022
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Feb 1, 2022

It looks like clippy's disallowed methods can't detect the use of
disallowed operators, so #1456 misses a bunch of uses of the -
operator on Instants, mostly in metrics, tap, and the log timestamp
formatter.

This fixes all of them that I could find.

It looks like clippy's disallowed methods can't detect the use of
disallowed *operators*, so #1456 misses a bunch of uses of the `-`
operator on `Instant`s, mostly in metrics, tap, and the log timestamp
formatter.

This fixes all of them that I could find.
@hawkw hawkw requested review from olix0r and a team February 1, 2022 18:36
Copy link
Member Author

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i missed that a couple of those were actually <Instant> - <Duration> instead, which broke when changed to saturating_duration_since (and, the non-saturating subs were legit in that case since the Duration is not going to time travel)

linkerd/transport-metrics/src/report.rs Outdated Show resolved Hide resolved
linkerd/http-metrics/src/requests/report.rs Outdated Show resolved Hide resolved
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@olix0r olix0r merged commit d15cee8 into ver/saturating_duration_since Feb 1, 2022
@olix0r olix0r deleted the eliza/fix-minuses branch February 1, 2022 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants