Conversation
…s/rust-clippy into new-lint-bytes-count-to-len
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. Please see the contribution instructions for more information. |
Manishearth
left a comment
There was a problem hiding this comment.
Good start, some suggestions
| #[clippy::version = "1.60.0"] | ||
| pub BYTES_COUNT_TO_LEN, | ||
| complexity, | ||
| "Using bytest().count() when len() performs the same functionality" |
There was a problem hiding this comment.
| "Using bytest().count() when len() performs the same functionality" | |
| "Using bytes().count() when len() performs the same functionality" |
| if_chain! { | ||
| //check for method call called "count" | ||
| if let hir::ExprKind::MethodCall(count_path, count_args, _) = &expr.kind; | ||
| if count_path.ident.name == rustc_span::sym::count; |
There was a problem hiding this comment.
We should use match_def_path here and below
And we should ensure the type is str
|
☔ The latest upstream changes (presumably #8411) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@c-rus ping from triage. Can you have any question to work on this? |
|
@c-rus ping from triage. According the triage procedure, I'm closing this because 2 weeks have passed with no activity. If you have more time to work on this, feel free to reopen this. |
|
I'm interested in this PR. |
|
Yes, thanks! |
|
I opened a PR that took over. |
Fixes #8083
changelog:
• adds new lint
[`bytes_count_to_len`]to consider replacing.bytes().count()with.len()