-
Notifications
You must be signed in to change notification settings - Fork 14k
clippy::complexity fixes #105864
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
clippy::complexity fixes #105864
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switch from if f.is_none() { otherbb } else { f.unwrap() } to if let Some(f) = f { f } else { otherbb } here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return a_ui.can_name(placeholder.universe); | |
| a_ui.can_name(placeholder.universe) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally skipped the return, but I thought with the return it was more obvious that we get/return a bool here instead of just "computing something"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you prefer keeping it I'm fine with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return tcx.item_name(def_id).as_str() == "c_void" | |
| && (crate_name == sym::core || crate_name == sym::std || crate_name == sym::libc); | |
| tcx.item_name(def_id).as_str() == "c_void" | |
| && (crate_name == sym::core || crate_name == sym::std || crate_name == sym::libc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
|
r? @Nilstrieb Looks good, r=me after the two reviews |
filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool
|
@bors r=Nilstrieb |
Rollup of 5 pull requests Successful merges: - rust-lang#105682 (Use `expose_addr()` in `fmt::Pointer`) - rust-lang#105839 (Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators) - rust-lang#105864 (clippy::complexity fixes) - rust-lang#105882 (Don't ICE in closure arg borrow suggestion) - rust-lang#105889 (Fix `uninlined_format_args` in libtest) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool
r? @compiler-errors