Skip to content

Commit a457258

Browse files
committed
Use HirId instead of NodeId for lookup
1 parent 8a59f81 commit a457258

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clippy_lints/src/escape.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
122122
return;
123123
}
124124
if let Categorization::Rvalue(..) = cmt.cat {
125-
let id = map.hir_to_node_id(cmt.hir_id);
126-
if let Some(Node::Stmt(st)) = map.find(map.get_parent_node(id)) {
125+
if let Some(Node::Stmt(st)) = map.find_by_hir_id(map.get_parent_node_by_hir_id(cmt.hir_id)) {
127126
if let StmtKind::Local(ref loc) = st.node {
128127
if let Some(ref ex) = loc.init {
129128
if let ExprKind::Box(..) = ex.node {

0 commit comments

Comments
 (0)