len_without_is_empty : warning: struct Lru
has a public len
method, but the is_empty
method has an unexpected signature
#6972
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Lint name: len_without_is_empty
I tried this code:
I expected to see this happen: It should not generate warning
Instead, this happened: *
warning: struct
Lru
has a publiclen
method, but theis_empty
method has an unexpected signature--> xxx-async/src/cache/lru_cache.rs:175:5
|
175 | pub async fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note:
#[warn(clippy::len_without_is_empty)]
on by defaultnote:
is_empty
defined here--> xxx-async/src/cache/lru_cache.rs:170:5
|
170 | pub async fn is_empty(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: expected signature:
(&self) -> bool
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
*
Meta
cargo clippy -V
: clippy 0.1.52 (07e0e2e 2021-03-24))rustc -Vv
:rustc 1.53.0-nightly (07e0e2e 2021-03-24)
binary: rustc
commit-hash: 07e0e2e
commit-date: 2021-03-24
host: x86_64-apple-darwin
release: 1.53.0-nightly
LLVM version: 12.0.0
The text was updated successfully, but these errors were encountered: