Skip to content

Commit c84f2b2

Browse files
committed
Remove some unnecessary uses of FieldDef::ident
1 parent 72e74d7 commit c84f2b2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
398398
}
399399
match tcx.type_of(did).kind() {
400400
ty::Adt(def, _) if def.is_enum() => {
401-
if let Some(field) =
402-
def.all_fields().find(|f| f.ident(tcx).name == variant_field_name)
401+
if let Some(field) = def.all_fields().find(|f| f.name == variant_field_name)
403402
{
404403
Ok((ty_res, Some(ItemFragment(FragmentKind::VariantField, field.did))))
405404
} else {
@@ -770,11 +769,8 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
770769
ty::Adt(def, _) if !def.is_enum() => def,
771770
_ => return None,
772771
};
773-
let field = def
774-
.non_enum_variant()
775-
.fields
776-
.iter()
777-
.find(|item| item.ident(tcx).name == item_name)?;
772+
let field =
773+
def.non_enum_variant().fields.iter().find(|item| item.name == item_name)?;
778774
Some((root_res, ItemFragment(FragmentKind::StructField, field.did)))
779775
}
780776
Res::Def(DefKind::Trait, did) => tcx

0 commit comments

Comments
 (0)