@@ -243,7 +243,7 @@ impl EFIMemoryMapTag {
243243 ///
244244 /// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
245245 /// available memory areas for tables and such.
246- pub fn memory_areas ( & self ) -> EFIMemoryAreaIter {
246+ pub fn memory_areas ( & self ) -> EFIMemoryAreaIter < & EFIMemoryDesc > {
247247 let self_ptr = self as * const EFIMemoryMapTag ;
248248 let start_area = ( & self . descs [ 0 ] ) as * const EFIMemoryDesc ;
249249 EFIMemoryAreaIter {
@@ -259,10 +259,10 @@ impl EFIMemoryMapTag {
259259 ///
260260 /// This differs from `MemoryMapTag` as for UEFI, the OS needs some non-
261261 /// 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 > {
263263 let self_ptr = self as * mut EFIMemoryMapTag ;
264264 let start_area = ( & mut self . descs [ 0 ] ) as * mut EFIMemoryDesc ;
265- EFIMemoryAreaIterMut {
265+ EFIMemoryAreaIter {
266266 current_area : start_area as u64 ,
267267 // NOTE: `last_area` is only a bound, it doesn't necessarily point exactly to the last element
268268 last_area : ( self_ptr as * mut ( ) as u64 + self . size as u64 ) ,
@@ -329,14 +329,14 @@ impl StructAsBytes for EFIBootServicesNotExitedTag {
329329
330330/// An iterator over ALL EFI memory areas.
331331#[ derive( Clone , Debug ) ]
332- pub struct EFIMemoryAreaIter < ' a > {
332+ pub struct EFIMemoryAreaIter < T > {
333333 current_area : u64 ,
334334 last_area : u64 ,
335335 entry_size : u32 ,
336- phantom : PhantomData < & ' a EFIMemoryDesc > ,
336+ phantom : PhantomData < T > ,
337337}
338338
339- impl < ' a > Iterator for EFIMemoryAreaIter < ' a > {
339+ impl < ' a > Iterator for EFIMemoryAreaIter < & ' a EFIMemoryDesc > {
340340 type Item = & ' a EFIMemoryDesc ;
341341 fn next ( & mut self ) -> Option < & ' a EFIMemoryDesc > {
342342 if self . current_area > self . last_area {
@@ -349,16 +349,7 @@ impl<'a> Iterator for EFIMemoryAreaIter<'a> {
349349 }
350350}
351351
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 > {
362353 type Item = & ' a mut EFIMemoryDesc ;
363354 fn next ( & mut self ) -> Option < & ' a mut EFIMemoryDesc > {
364355 if self . current_area > self . last_area {
0 commit comments