Skip to content

Commit 3de7276

Browse files
authored
Rollup merge of #92799 - rust-lang:followup-from-92533, r=Aaron1011
Remove some unnecessary uses of `FieldDef::ident` Followup from #92533. cc ``@Aaron1011`` ``@petrochenkov``
2 parents 869b7bc + c84f2b2 commit 3de7276

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
436436
}
437437
match tcx.type_of(did).kind() {
438438
ty::Adt(def, _) if def.is_enum() => {
439-
if let Some(field) =
440-
def.all_fields().find(|f| f.ident(tcx).name == variant_field_name)
439+
if let Some(field) = def.all_fields().find(|f| f.name == variant_field_name)
441440
{
442441
Ok((ty_res, Some(ItemFragment(FragmentKind::VariantField, field.did))))
443442
} else {
@@ -806,11 +805,8 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
806805
ty::Adt(def, _) if !def.is_enum() => def,
807806
_ => return None,
808807
};
809-
let field = def
810-
.non_enum_variant()
811-
.fields
812-
.iter()
813-
.find(|item| item.ident(tcx).name == item_name)?;
808+
let field =
809+
def.non_enum_variant().fields.iter().find(|item| item.name == item_name)?;
814810
Some((root_res, ItemFragment(FragmentKind::StructField, field.did)))
815811
}
816812
Res::Def(DefKind::Trait, did) => tcx

0 commit comments

Comments
 (0)