Skip to content

Conversation

matthiaskrgr
Copy link
Member

useless_format
map_flatten
useless_conversion
needless_bool
filter_next
clone_on_copy
needless_option_as_deref

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 3, 2022
@rust-highfive
Copy link
Contributor

r? @estebank

(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 Feb 3, 2022
useless_format
map_flatten
useless_conversion
needless_bool
filter_next
clone_on_copy
needless_option_as_deref
Comment on lines -223 to +232
let dead_code_cgu = if let Some(cgu) = cgus
.into_iter()
.rev()
.filter(|cgu| cgu.items().iter().any(|(_, (linkage, _))| *linkage == Linkage::External))
.next()
{
cgu
} else {
// If there are no CGUs that have externally linked items,
// then we just pick the first CGU as a fallback.
&mut post_inlining.codegen_units[0]
};
let dead_code_cgu =
if let Some(cgu) = cgus.into_iter().rev().find(|cgu| {
cgu.items().iter().any(|(_, (linkage, _))| *linkage == Linkage::External)
}) {
cgu
} else {
// If there are no CGUs that have externally linked items,
// then we just pick the first CGU as a fallback.
&mut post_inlining.codegen_units[0]
};
Copy link
Member Author

Choose a reason for hiding this comment

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

any().next() -> find() here

@matthiaskrgr matthiaskrgr force-pushed the clippy_complexity_jan_2022 branch from c37c45d to b80057d Compare February 3, 2022 22:17
@matthiaskrgr
Copy link
Member Author

r? @oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned estebank Feb 11, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Feb 17, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 17, 2022

📌 Commit b80057d has been approved by oli-obk

@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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 17, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 17, 2022
…2022, r=oli-obk

compiler: clippy::complexity fixes

useless_format
map_flatten
useless_conversion
needless_bool
filter_next
clone_on_copy
needless_option_as_deref
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 18, 2022
…askrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#92683 (Suggest copying trait associated type bounds on lifetime error)
 - rust-lang#92933 (Deny mixing bin crate type with lib crate types)
 - rust-lang#92959 (Add more info and suggestions to use of #[test] on invalid items)
 - rust-lang#93024 (Do not ICE when inlining a function with un-satisfiable bounds)
 - rust-lang#93613 (Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator`)
 - rust-lang#93634 (compiler: clippy::complexity fixes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a144ea1 into rust-lang:master Feb 18, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 18, 2022
@matthiaskrgr matthiaskrgr deleted the clippy_complexity_jan_2022 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
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants