Fix formatting
This commit is contained in:
parent
ba05b764bc
commit
0dd8b27b6b
@ -1332,17 +1332,13 @@ pub fn deref_chain<'cx, 'tcx>(cx: &'cx LateContext<'tcx>, ty: Ty<'tcx>) -> impl
|
|||||||
/// If you need this, you should wrap this call in `clippy_utils::ty::deref_chain().any(...)`.
|
/// If you need this, you should wrap this call in `clippy_utils::ty::deref_chain().any(...)`.
|
||||||
pub fn get_adt_inherent_method<'a>(cx: &'a LateContext<'_>, ty: Ty<'_>, method_name: Symbol) -> Option<&'a AssocItem> {
|
pub fn get_adt_inherent_method<'a>(cx: &'a LateContext<'_>, ty: Ty<'_>, method_name: Symbol) -> Option<&'a AssocItem> {
|
||||||
if let Some(ty_did) = ty.ty_adt_def().map(AdtDef::did) {
|
if let Some(ty_did) = ty.ty_adt_def().map(AdtDef::did) {
|
||||||
cx.tcx
|
cx.tcx.inherent_impls(ty_did).into_iter().flatten().find_map(|&did| {
|
||||||
.inherent_impls(ty_did)
|
cx.tcx
|
||||||
.into_iter()
|
.associated_items(did)
|
||||||
.flatten()
|
.filter_by_name_unhygienic(method_name)
|
||||||
.find_map(|&did| {
|
.next()
|
||||||
cx.tcx
|
.filter(|item| item.kind == AssocKind::Fn)
|
||||||
.associated_items(did)
|
})
|
||||||
.filter_by_name_unhygienic(method_name)
|
|
||||||
.next()
|
|
||||||
.filter(|item| item.kind == AssocKind::Fn)
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user