Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reword help message for len_zero #3322

Closed
gyscos opened this issue Oct 16, 2018 · 2 comments
Closed

Reword help message for len_zero #3322

gyscos opened this issue Oct 16, 2018 · 2 comments
Labels
good-first-issue These issues are a good way to get started with Clippy

Comments

@gyscos
Copy link

gyscos commented Oct 16, 2018

When calling .len() == 0 on something with a .is_empty() method, a lint is triggered with the following help message:

help: using `is_empty` is more concise: `self.buffer.is_empty()`

Mentioning concision rather than clarity is a bit misleading; .len() == 0 and .is_empty() have actually the exact same number of characters.

I suggest rewording it like this:

help: using `is_empty` is clearer and more explicit: `self.buffer.is_empty()`

(Run with clippy 0.0.212 (32b1d1f 2018-10-05))

@oli-obk oli-obk added the good-first-issue These issues are a good way to get started with Clippy label Oct 16, 2018
@giogam
Copy link

giogam commented Oct 16, 2018

Hi I'd like to take this as my first issue.

@CYBAI
Copy link
Contributor

CYBAI commented Oct 18, 2018

As #3326 merged, maybe this can be closed? 😄

@oli-obk oli-obk closed this as completed Oct 18, 2018
lukasstevens pushed a commit to lukasstevens/rust-clippy that referenced this issue Oct 18, 2018
lukasstevens pushed a commit to lukasstevens/rust-clippy that referenced this issue Oct 18, 2018
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue May 5, 2020
Changes:
````
new_ret_no_self: add sample from rust-lang#3313 to Known Problems section.
Support multiline comments and hopefully fix panic
Check for comments in collapsible ifs
Resolve ICE in needless range loop lint
RIIR update_lints: Update changelog links
Rename if_let_redundant_pattern_matching to redundant_pattern_matching
Add lint for redundant pattern matching for explicit return boolean
Fix issue rust-lang#3322: reword help message for len_zero
Simplify manual_memcpy suggestion in some cases
Fix dogfood
Update known problems for unnecessary_fold
RIIR update_lints: Replace lint count in README.md
Rename `active_lints` to `usable_lints`
Add comment on WalkDir vs. fs::read_dir
sort_by -> sort_by_key
Some more documentation for clippy_dev
Use `WalkDir` to also gather from subdirectories
Avoid linting `boxed_local` on trait implementations.
Website: Make lint categories linkable
Restore clippy_dummy's placeholder name
Swap order of methods in `needless_range_loop` suggestion in some cases
Revert "Exclude pattern guards from unnecessary_fold lint"
Exclude pattern guards from unnecessary_fold lint
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

No branches or pull requests

4 participants