소스 검색

Loosen lifetime on `Memory.regions`

The current lifetime suggests that the returned iterator references
the `Memory` itself, but it only references the `Fdt`.
Sven Bartscher 2 년 전
부모
커밋
e8d7f71931
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/standard_nodes.rs

+ 2 - 2
src/standard_nodes.rs

@@ -250,9 +250,9 @@ pub struct Memory<'b, 'a: 'b> {
     pub(crate) node: FdtNode<'b, 'a>,
 }
 
-impl Memory<'_, '_> {
+impl<'a> Memory<'_, 'a> {
     /// Returns an iterator over all of the available memory regions
-    pub fn regions(&self) -> impl Iterator<Item = MemoryRegion> + '_ {
+    pub fn regions(&self) -> impl Iterator<Item = MemoryRegion> + 'a {
         self.node.reg().unwrap()
     }