@@ -317,7 +317,7 @@ impl EFIMemoryMapTag {
317
317
///
318
318
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
319
319
/// available memory areas for tables and such.
320
- pub fn memory_areas ( & self ) -> EFIMemoryAreaIter {
320
+ pub fn memory_areas ( & self ) -> EFIMemoryAreaIter < & EFIMemoryDesc > {
321
321
let self_ptr = self as * const EFIMemoryMapTag ;
322
322
let start_area = ( & self . descs [ 0 ] ) as * const EFIMemoryDesc ;
323
323
EFIMemoryAreaIter {
@@ -333,10 +333,10 @@ impl EFIMemoryMapTag {
333
333
///
334
334
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
335
335
/// available memory areas for tables and such.
336
- pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIterMut {
336
+ pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIter < & mut EFIMemoryDesc > {
337
337
let self_ptr = self as * mut EFIMemoryMapTag ;
338
338
let start_area = ( & mut self . descs [ 0 ] ) as * mut EFIMemoryDesc ;
339
- EFIMemoryAreaIterMut {
339
+ EFIMemoryAreaIter {
340
340
current_area : start_area as u64 ,
341
341
// NOTE: `last_area` is only a bound, it doesn't necessarily point exactly to the last element
342
342
last_area : ( self_ptr as * mut ( ) as u64 + self . size as u64 ) ,
@@ -390,14 +390,14 @@ impl TagTrait for EFIBootServicesNotExitedTag {
390
390
391
391
/// An iterator over ALL EFI memory areas.
392
392
#[ derive( Clone , Debug ) ]
393
- pub struct EFIMemoryAreaIter < ' a > {
393
+ pub struct EFIMemoryAreaIter < T > {
394
394
current_area : u64 ,
395
395
last_area : u64 ,
396
396
entry_size : u32 ,
397
- phantom : PhantomData < & ' a EFIMemoryDesc > ,
397
+ phantom : PhantomData < T > ,
398
398
}
399
399
400
- impl < ' a > Iterator for EFIMemoryAreaIter < ' a > {
400
+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a EFIMemoryDesc > {
401
401
type Item = & ' a EFIMemoryDesc ;
402
402
fn next ( & mut self ) -> Option < & ' a EFIMemoryDesc > {
403
403
if self . current_area > self . last_area {
@@ -410,16 +410,7 @@ impl<'a> Iterator for EFIMemoryAreaIter<'a> {
410
410
}
411
411
}
412
412
413
- /// An iterator over ALL EFI memory areas, mutably.
414
- #[ derive( Clone , Debug ) ]
415
- pub struct EFIMemoryAreaIterMut < ' a > {
416
- current_area : u64 ,
417
- last_area : u64 ,
418
- entry_size : u32 ,
419
- phantom : PhantomData < & ' a mut EFIMemoryDesc > ,
420
- }
421
-
422
- impl < ' a > Iterator for EFIMemoryAreaIterMut < ' a > {
413
+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a mut EFIMemoryDesc > {
423
414
type Item = & ' a mut EFIMemoryDesc ;
424
415
fn next ( & mut self ) -> Option < & ' a mut EFIMemoryDesc > {
425
416
if self . current_area > self . last_area {
0 commit comments