Skip to content

Commit c0f49a9

Browse files
committedJan 30, 2024
hir: Simplify hir_owner_nodes query
The query accept arbitrary DefIds, not just owner DefIds. The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom. Also rename the query to `opt_hir_owner_nodes`.
1 parent a51fc2a commit c0f49a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎clippy_lints/src/min_ident_chars.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
9393
// reimplement it even if we wanted to
9494
cx.tcx.opt_hir_node(hir_id)
9595
} else {
96-
let Some(owner) = cx.tcx.hir_owner_nodes(hir_id.owner).as_owner() else {
96+
let Some(owner) = cx.tcx.opt_hir_owner_nodes(hir_id.owner) else {
9797
return;
9898
};
9999
owner.nodes.get(hir_id.local_id).copied().flatten().map(|p| p.node)

0 commit comments

Comments
 (0)