Consider excluding Duration's associated constants from identity_op lint #3866
Labels
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
I-false-positive
Issue: The lint was triggered on code it shouldn't have
This came up in the tracking issue for
std::time::Duration::SECOND
and friends: rust-lang/rust#57391.The following code using
1 * SECOND
arguably reads more clearly in English thanthread::sleep(SECOND)
.The same pattern is common in Go which uses a similar mechanism for time constants. From a brief search, here are some articles that use
1 * time.Second
or1*time.Second
in Go:This may indicate that this pattern does not fall under the "obscures what’s going on" description of the identity_op lint.
clippy 0.0.212 (5d78250 2019-03-07)
The text was updated successfully, but these errors were encountered: