Skip to content

Commit c09778d

Browse files
committed
use def_span and def_kind queries instead of calling tcx.hir() methods
Signed-off-by: Miguel Guarniz <[email protected]>
1 parent 7cd86aa commit c09778d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clippy_lints/src/same_name_method.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
5151
let mut map = FxHashMap::<Res, ExistingName>::default();
5252

5353
for id in cx.tcx.hir().items() {
54-
if matches!(cx.tcx.hir().def_kind(id.def_id), DefKind::Impl)
54+
if matches!(cx.tcx.def_kind(id.def_id), DefKind::Impl)
5555
&& let item = cx.tcx.hir().item(id)
5656
&& let ItemKind::Impl(Impl {
57-
items,
58-
of_trait,
59-
self_ty,
60-
..
61-
}) = &item.kind
57+
items,
58+
of_trait,
59+
self_ty,
60+
..
61+
}) = &item.kind
6262
&& let TyKind::Path(QPath::Resolved(_, Path { res, .. })) = self_ty.kind
6363
{
6464
if !map.contains_key(res) {

0 commit comments

Comments
 (0)