-
Notifications
You must be signed in to change notification settings - Fork 13.3k
clippy::complexity fixes #116209
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 #116209
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -20,8 +20,7 @@ fn needs_drop_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx> | |||||||
let adt_has_dtor = | ||||||||
|adt_def: ty::AdtDef<'tcx>| adt_def.destructor(tcx).map(|_| DtorType::Significant); | ||||||||
let res = drop_tys_helper(tcx, query.value, query.param_env, adt_has_dtor, false) | ||||||||
.filter(filter_array_elements(tcx, query.param_env)) | ||||||||
.next() | ||||||||
.find(filter_array_elements(tcx, query.param_env)) | ||||||||
.is_some(); | ||||||||
|
||||||||
debug!("needs_drop_raw({:?}) = {:?}", query, res); | ||||||||
|
@@ -56,8 +55,7 @@ fn has_significant_drop_raw<'tcx>( | |||||||
adt_consider_insignificant_dtor(tcx), | ||||||||
true, | ||||||||
) | ||||||||
.filter(filter_array_elements(tcx, query.param_env)) | ||||||||
.next() | ||||||||
.find(filter_array_elements(tcx, query.param_env)) | ||||||||
.is_some(); | ||||||||
Comment on lines
+58
to
59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be able to fix it by introducing a closure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, just edit the signature of |
||||||||
debug!("has_significant_drop_raw({:?}) = {:?}", query, res); | ||||||||
res | ||||||||
|
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.