@@ -319,7 +319,7 @@ impl EFIMemoryMapTag {
319
319
///
320
320
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
321
321
/// available memory areas for tables and such.
322
- pub fn memory_areas ( & self ) -> EFIMemoryAreaIter {
322
+ pub fn memory_areas ( & self ) -> EFIMemoryAreaIter < & EFIMemoryDesc > {
323
323
let self_ptr = self as * const EFIMemoryMapTag ;
324
324
let start_area = ( & self . descs [ 0 ] ) as * const EFIMemoryDesc ;
325
325
EFIMemoryAreaIter {
@@ -335,10 +335,10 @@ impl EFIMemoryMapTag {
335
335
///
336
336
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
337
337
/// 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 > {
339
339
let self_ptr = self as * mut EFIMemoryMapTag ;
340
340
let start_area = ( & mut self . descs [ 0 ] ) as * mut EFIMemoryDesc ;
341
- EFIMemoryAreaIterMut {
341
+ EFIMemoryAreaIter {
342
342
current_area : start_area as u64 ,
343
343
// NOTE: `last_area` is only a bound, it doesn't necessarily point exactly to the last element
344
344
last_area : ( self_ptr as * mut ( ) as u64 + self . size as u64 ) ,
@@ -361,14 +361,14 @@ impl TagTrait for EFIMemoryMapTag {
361
361
362
362
/// An iterator over ALL EFI memory areas.
363
363
#[ derive( Clone , Debug ) ]
364
- pub struct EFIMemoryAreaIter < ' a > {
364
+ pub struct EFIMemoryAreaIter < T > {
365
365
current_area : u64 ,
366
366
last_area : u64 ,
367
367
entry_size : u32 ,
368
- phantom : PhantomData < & ' a EFIMemoryDesc > ,
368
+ phantom : PhantomData < T > ,
369
369
}
370
370
371
- impl < ' a > Iterator for EFIMemoryAreaIter < ' a > {
371
+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a EFIMemoryDesc > {
372
372
type Item = & ' a EFIMemoryDesc ;
373
373
fn next ( & mut self ) -> Option < & ' a EFIMemoryDesc > {
374
374
if self . current_area > self . last_area {
@@ -381,16 +381,7 @@ impl<'a> Iterator for EFIMemoryAreaIter<'a> {
381
381
}
382
382
}
383
383
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 > {
394
385
type Item = & ' a mut EFIMemoryDesc ;
395
386
fn next ( & mut self ) -> Option < & ' a mut EFIMemoryDesc > {
396
387
if self . current_area > self . last_area {
0 commit comments