]> git.lizzy.rs Git - rust.git/commitdiff
fix: replace wrong id
authorljedrz <ljedrz@gmail.com>
Mon, 25 Feb 2019 10:06:46 +0000 (11:06 +0100)
committerljedrz <ljedrz@gmail.com>
Mon, 25 Feb 2019 10:06:46 +0000 (11:06 +0100)
clippy_lints/src/utils/mod.rs

index 88636c6e47545462ba51968280573feaa30ce7bb..ee148ce35588ff9831bff6f4895461af9a93f9a2 100644 (file)
@@ -576,7 +576,7 @@ pub fn get_parent_expr<'c>(cx: &'c LateContext<'_, '_>, e: &Expr) -> Option<&'c
     if hir_id == parent_id {
         return None;
     }
-    map.find_by_hir_id(hir_id).and_then(|node| {
+    map.find_by_hir_id(parent_id).and_then(|node| {
         if let Node::Expr(parent) = node {
             Some(parent)
         } else {