浏览代码

Fix borrowing issue

For some reason, the borrow checker was emitting a warning instead of an
error for a borrowing issue, so I missed it.
Isaac Woods 5 年之前
父节点
当前提交
0bd7addea1
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      aml_parser/src/namespace.rs

+ 2 - 2
aml_parser/src/namespace.rs

@@ -83,8 +83,8 @@ impl Namespace {
     }
 
     pub fn get_by_path(&self, path: &AmlName) -> Result<&AmlValue, AmlError> {
-        let handle = self.name_map.get(path).ok_or(AmlError::ObjectDoesNotExist(path.as_string()))?;
-        self.get(*handle).map_err(|_| AmlError::ObjectDoesNotExist(path.as_string()))
+        let handle = *self.name_map.get(path).ok_or(AmlError::ObjectDoesNotExist(path.as_string()))?;
+        self.get(handle).map_err(|_| AmlError::ObjectDoesNotExist(path.as_string()))
     }
 
     /// Search for an object at the given path of the namespace, applying the search rules