@@ -319,7 +319,7 @@ impl EFIMemoryMapTag {
319319 ///
320320 /// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
321321 /// available memory areas for tables and such.
322- pub fn memory_areas ( & self ) -> EFIMemoryAreaIter {
322+ pub fn memory_areas ( & self ) -> EFIMemoryAreaIter < & EFIMemoryDesc > {
323323 let self_ptr = self as * const EFIMemoryMapTag ;
324324 let start_area = ( & self . descs [ 0 ] ) as * const EFIMemoryDesc ;
325325 EFIMemoryAreaIter {
@@ -335,10 +335,10 @@ impl EFIMemoryMapTag {
335335 ///
336336 /// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
337337 /// available memory areas for tables and such.
338- pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIterMut {
338+ pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIter < & mut EFIMemoryDesc > {
339339 let self_ptr = self as * mut EFIMemoryMapTag ;
340340 let start_area = ( & mut self . descs [ 0 ] ) as * mut EFIMemoryDesc ;
341- EFIMemoryAreaIterMut {
341+ EFIMemoryAreaIter {
342342 current_area : start_area as u64 ,
343343 // NOTE: `last_area` is only a bound, it doesn't necessarily point exactly to the last element
344344 last_area : ( self_ptr as * mut ( ) as u64 + self . size as u64 ) ,
@@ -361,14 +361,14 @@ impl TagTrait for EFIMemoryMapTag {
361361
362362/// An iterator over ALL EFI memory areas.
363363#[ derive( Clone , Debug ) ]
364- pub struct EFIMemoryAreaIter < ' a > {
364+ pub struct EFIMemoryAreaIter < T > {
365365 current_area : u64 ,
366366 last_area : u64 ,
367367 entry_size : u32 ,
368- phantom : PhantomData < & ' a EFIMemoryDesc > ,
368+ phantom : PhantomData < T > ,
369369}
370370
371- impl < ' a > Iterator for EFIMemoryAreaIter < ' a > {
371+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a EFIMemoryDesc > {
372372 type Item = & ' a EFIMemoryDesc ;
373373 fn next ( & mut self ) -> Option < & ' a EFIMemoryDesc > {
374374 if self . current_area > self . last_area {
@@ -381,16 +381,7 @@ impl<'a> Iterator for EFIMemoryAreaIter<'a> {
381381 }
382382}
383383
384- /// An iterator over ALL EFI memory areas, mutably.
385- #[ derive( Clone , Debug ) ]
386- pub struct EFIMemoryAreaIterMut < ' a > {
387- current_area : u64 ,
388- last_area : u64 ,
389- entry_size : u32 ,
390- phantom : PhantomData < & ' a mut EFIMemoryDesc > ,
391- }
392-
393- impl < ' a > Iterator for EFIMemoryAreaIterMut < ' a > {
384+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a mut EFIMemoryDesc > {
394385 type Item = & ' a mut EFIMemoryDesc ;
395386 fn next ( & mut self ) -> Option < & ' a mut EFIMemoryDesc > {
396387 if self . current_area > self . last_area {
0 commit comments