Skip to content

clippy::complexity fixes #89649

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

Merged
merged 1 commit into from
Oct 9, 2021
Merged

clippy::complexity fixes #89649

merged 1 commit into from
Oct 9, 2021

Conversation

matthiaskrgr
Copy link
Member

No description provided.

@rust-highfive
Copy link
Contributor

r? @michaelwoerister

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2021
@rust-log-analyzer

This comment has been minimized.

@@ -972,8 +972,7 @@ fn suggest_ampmut<'tcx>(
if let Some(assignment_rhs_span) = opt_assignment_rhs_span {
if let Ok(src) = tcx.sess.source_map().span_to_snippet(assignment_rhs_span) {
let is_mutbl = |ty: &str| -> bool {
if ty.starts_with("mut") {
let rest = &ty[3..];
if let Some(rest) = ty.strip_prefix("mut") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing string parsing on types seems weird, what if there's a type named mutex or something ... ?

But this is pre-existing so it doesn't need to block the PR.

@@ -363,7 +363,7 @@ impl Collector<'tcx> {
.collect::<Vec<_>>();
if existing.is_empty() {
// Add if not found
let new_name = passed_lib.new_name.as_ref().map(|s| &**s); // &Option<String> -> Option<&str>
let new_name = passed_lib.new_name.as_deref(); // &Option<String> -> Option<&str>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to remove this comment at the same time, it's explained in the docs for as_deref.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, I replaced the comment by a type annotation on let new_name

@jyn514
Copy link
Member

jyn514 commented Oct 8, 2021

r=me with #89649 (comment) addressed :)

@jyn514 jyn514 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2021
@jyn514
Copy link
Member

jyn514 commented Oct 8, 2021

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 8, 2021

📌 Commit e6f77a1 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 8, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 8, 2021
…laumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#86506 (Don't normalize xform_ret_ty during method candidate assembly )
 - rust-lang#89538 (Make rustdoc not highlight `->` and `=>` as operators)
 - rust-lang#89649 (clippy::complexity fixes)
 - rust-lang#89668 (Cfg hide more conditions for core and alloc)
 - rust-lang#89669 (Remove special-casing of never primitive in rustdoc-json-types)
 - rust-lang#89672 (Remove unwrap_or! macro)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 836597a into rust-lang:master Oct 9, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 9, 2021
@matthiaskrgr matthiaskrgr deleted the clippycompl branch January 25, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants