ソースを参照

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