Skip to content

Commit

Permalink
use def_span and def_kind queries instead of calling tcx.hir() methods
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Guarniz <[email protected]>
  • Loading branch information
kckeiks committed May 6, 2022
1 parent 7cd86aa commit c09778d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clippy_lints/src/same_name_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
let mut map = FxHashMap::<Res, ExistingName>::default();

for id in cx.tcx.hir().items() {
if matches!(cx.tcx.hir().def_kind(id.def_id), DefKind::Impl)
if matches!(cx.tcx.def_kind(id.def_id), DefKind::Impl)
&& let item = cx.tcx.hir().item(id)
&& let ItemKind::Impl(Impl {
items,
of_trait,
self_ty,
..
}) = &item.kind
items,
of_trait,
self_ty,
..
}) = &item.kind
&& let TyKind::Path(QPath::Resolved(_, Path { res, .. })) = self_ty.kind
{
if !map.contains_key(res) {
Expand Down

0 comments on commit c09778d

Please sign in to comment.