We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
instant.elapsed()
Instant::now() - instant
Suggests using the helper shortcut method, which is shorter.
https://doc.rust-lang.org/stable/std/time/struct.Instant.html#method.elapsed
No response
let prev_instant = Instant::now(); // ... let duration = Instant::now() - prev_instant();
Could be written as:
let prev_instant = Instant::now(); // ... let duration = prev_instant.elapsed();
The text was updated successfully, but these errors were encountered:
@rustbot label +good-first-issue
Sorry, something went wrong.
@rustbot claim
elapsed_instant
Auto merge of #9264 - guerinoni:instant-elapsed, r=Alexendoo
00e59cd
Add `elapsed_instant` lint Closes #8603 - \[x] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` --- changelog: [`elapsed_instant`]: Add lint
0696624
Alastair-smith2
Successfully merging a pull request may close this issue.
What it does
Suggests using the helper shortcut method, which is shorter.
https://doc.rust-lang.org/stable/std/time/struct.Instant.html#method.elapsed
Lint Name
No response
Category
No response
Advantage
No response
Drawbacks
No response
Example
Could be written as:
The text was updated successfully, but these errors were encountered: