From 749bc6a4b038a0729f4c556174ff7f6fe519d184 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Sun, 4 Jul 2021 15:32:44 +0900 Subject: [PATCH] chore: rewrite with `impl Iterator` This makes what type the iterator iterates clear. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 945b959..9d0edf2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,7 +58,7 @@ impl<'a> ElfFile<'a> { sections::parse_section_header(self.input, self.header, index) } - pub fn section_iter<'b>(&'b self) -> SectionIter<'b, 'a> { + pub fn section_iter(&self) -> impl Iterator> + '_ { SectionIter { file: self, next_index: 0, @@ -69,7 +69,7 @@ impl<'a> ElfFile<'a> { program::parse_program_header(self.input, self.header, index) } - pub fn program_iter<'b>(&'b self) -> ProgramIter<'b, 'a> { + pub fn program_iter(&self) -> impl Iterator> { ProgramIter { file: self, next_index: 0,