-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-lintArea: New lintsArea: New lintsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
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
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();
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy