Commit Graph

8 Commits

Author SHA1 Message Date
David Mládek
536905278f Include async functions in the len_without_is_empty
Co-authored-by: Akshay <nerdy@peppe.rs>
2023-03-07 22:04:11 +01:00
ksaleem
2fd94a4e01 prevents len_without_is_empty from yielding positive when len takes
more than just `&self` in non-standard implementations.

changelog: Fix [`len_without_is_empty`] false positive when len has a
non-standard method signature

Fixes #9520
2023-01-29 17:35:36 -05:00
Jacob Kiesel
9925600870 dogfood inverse bool_to_int_with_if 2022-09-14 13:35:32 -06:00
Andre Bogus
a4ede72b3d update most tests to 2021 edition 2021-10-30 14:50:53 +02:00
Jason Newcomb
12985afbca
len_without_is_empty improvements
Check the return type of `len`. Only integral types, or an `Option` or `Result` wrapping one.
Ensure the return type of `is_empty` matches. e.g. `Option<usize>` -> `Option<bool>`
2021-03-27 09:04:44 -04:00
Jason Newcomb
47145dec36
len_without_is_empty will now consider multiple impl blocks
`len_without_is_empty` will now consider `#[allow]` on both the `len` method, and the type definition
2021-03-07 09:40:18 -05:00
Christoph Walcher
c87d999fa2
fix ui tests 2020-08-07 18:08:51 +02:00
Philipp Hansch
bae7d29dbe
Add run-rustfix for len_zero lint
* Extracts len_without_is_empty into separate file
* Adds `// run-rustfix` to `tests/ui/len_zero.rs`
2019-04-16 21:46:07 +02:00