@@ -315,7 +315,7 @@ impl EFIMemoryMapTag {
315
315
///
316
316
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
317
317
/// available memory areas for tables and such.
318
- pub fn memory_areas ( & self ) -> EFIMemoryAreaIter {
318
+ pub fn memory_areas ( & self ) -> EFIMemoryAreaIter < & EFIMemoryDesc > {
319
319
let self_ptr = self as * const EFIMemoryMapTag ;
320
320
let start_area = ( & self . descs [ 0 ] ) as * const EFIMemoryDesc ;
321
321
EFIMemoryAreaIter {
@@ -331,10 +331,10 @@ impl EFIMemoryMapTag {
331
331
///
332
332
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
333
333
/// available memory areas for tables and such.
334
- pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIterMut {
334
+ pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIter < & mut EFIMemoryDesc > {
335
335
let self_ptr = self as * mut EFIMemoryMapTag ;
336
336
let start_area = ( & mut self . descs [ 0 ] ) as * mut EFIMemoryDesc ;
337
- EFIMemoryAreaIterMut {
337
+ EFIMemoryAreaIter {
338
338
current_area : start_area as u64 ,
339
339
// NOTE: `last_area` is only a bound, it doesn't necessarily point exactly to the last element
340
340
last_area : ( self_ptr as * mut ( ) as u64 + self . size as u64 ) ,
@@ -401,14 +401,14 @@ impl StructAsBytes for EFIBootServicesNotExitedTag {
401
401
402
402
/// An iterator over ALL EFI memory areas.
403
403
#[ derive( Clone , Debug ) ]
404
- pub struct EFIMemoryAreaIter < ' a > {
404
+ pub struct EFIMemoryAreaIter < T > {
405
405
current_area : u64 ,
406
406
last_area : u64 ,
407
407
entry_size : u32 ,
408
- phantom : PhantomData < & ' a EFIMemoryDesc > ,
408
+ phantom : PhantomData < T > ,
409
409
}
410
410
411
- impl < ' a > Iterator for EFIMemoryAreaIter < ' a > {
411
+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a EFIMemoryDesc > {
412
412
type Item = & ' a EFIMemoryDesc ;
413
413
fn next ( & mut self ) -> Option < & ' a EFIMemoryDesc > {
414
414
if self . current_area > self . last_area {
@@ -421,16 +421,7 @@ impl<'a> Iterator for EFIMemoryAreaIter<'a> {
421
421
}
422
422
}
423
423
424
- /// An iterator over ALL EFI memory areas, mutably.
425
- #[ derive( Clone , Debug ) ]
426
- pub struct EFIMemoryAreaIterMut < ' a > {
427
- current_area : u64 ,
428
- last_area : u64 ,
429
- entry_size : u32 ,
430
- phantom : PhantomData < & ' a mut EFIMemoryDesc > ,
431
- }
432
-
433
- impl < ' a > Iterator for EFIMemoryAreaIterMut < ' a > {
424
+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a mut EFIMemoryDesc > {
434
425
type Item = & ' a mut EFIMemoryDesc ;
435
426
fn next ( & mut self ) -> Option < & ' a mut EFIMemoryDesc > {
436
427
if self . current_area > self . last_area {
0 commit comments