Closed
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();