@@ -243,7 +243,7 @@ impl EFIMemoryMapTag {
243
243
///
244
244
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
245
245
/// available memory areas for tables and such.
246
- pub fn memory_areas ( & self ) -> EFIMemoryAreaIter {
246
+ pub fn memory_areas ( & self ) -> EFIMemoryAreaIter < & EFIMemoryDesc > {
247
247
let self_ptr = self as * const EFIMemoryMapTag ;
248
248
let start_area = ( & self . descs [ 0 ] ) as * const EFIMemoryDesc ;
249
249
EFIMemoryAreaIter {
@@ -259,10 +259,10 @@ impl EFIMemoryMapTag {
259
259
///
260
260
/// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
261
261
/// available memory areas for tables and such.
262
- pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIterMut {
262
+ pub fn memory_areas_mut ( & mut self ) -> EFIMemoryAreaIter < & mut EFIMemoryDesc > {
263
263
let self_ptr = self as * mut EFIMemoryMapTag ;
264
264
let start_area = ( & mut self . descs [ 0 ] ) as * mut EFIMemoryDesc ;
265
- EFIMemoryAreaIterMut {
265
+ EFIMemoryAreaIter {
266
266
current_area : start_area as u64 ,
267
267
// NOTE: `last_area` is only a bound, it doesn't necessarily point exactly to the last element
268
268
last_area : ( self_ptr as * mut ( ) as u64 + self . size as u64 ) ,
@@ -329,14 +329,14 @@ impl StructAsBytes for EFIBootServicesNotExitedTag {
329
329
330
330
/// An iterator over ALL EFI memory areas.
331
331
#[ derive( Clone , Debug ) ]
332
- pub struct EFIMemoryAreaIter < ' a > {
332
+ pub struct EFIMemoryAreaIter < T > {
333
333
current_area : u64 ,
334
334
last_area : u64 ,
335
335
entry_size : u32 ,
336
- phantom : PhantomData < & ' a EFIMemoryDesc > ,
336
+ phantom : PhantomData < T > ,
337
337
}
338
338
339
- impl < ' a > Iterator for EFIMemoryAreaIter < ' a > {
339
+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a EFIMemoryDesc > {
340
340
type Item = & ' a EFIMemoryDesc ;
341
341
fn next ( & mut self ) -> Option < & ' a EFIMemoryDesc > {
342
342
if self . current_area > self . last_area {
@@ -349,16 +349,7 @@ impl<'a> Iterator for EFIMemoryAreaIter<'a> {
349
349
}
350
350
}
351
351
352
- /// An iterator over ALL EFI memory areas, mutably.
353
- #[ derive( Clone , Debug ) ]
354
- pub struct EFIMemoryAreaIterMut < ' a > {
355
- current_area : u64 ,
356
- last_area : u64 ,
357
- entry_size : u32 ,
358
- phantom : PhantomData < & ' a mut EFIMemoryDesc > ,
359
- }
360
-
361
- impl < ' a > Iterator for EFIMemoryAreaIterMut < ' a > {
352
+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a mut EFIMemoryDesc > {
362
353
type Item = & ' a mut EFIMemoryDesc ;
363
354
fn next ( & mut self ) -> Option < & ' a mut EFIMemoryDesc > {
364
355
if self . current_area > self . last_area {
0 commit comments