Skip to content

Commit

Permalink
read/elf: remove unneeded lifetimes (#681)
Browse files Browse the repository at this point in the history
While these should be true in practice, they aren't needed,
and their presence may require callers to annotate them too.
  • Loading branch information
philipc committed May 8, 2024
1 parent f0f2d55 commit 0643b61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/read/elf/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<'data, Elf: FileHeader, R: ReadRef<'data>> SectionTable<'data, Elf, R> {
pub fn section_name(
&self,
endian: Elf::Endian,
section: &'data Elf::SectionHeader,
section: &Elf::SectionHeader,
) -> read::Result<&'data [u8]> {
section.name(endian, self.strings)
}
Expand Down
8 changes: 2 additions & 6 deletions src/read/elf/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl<'data, Elf: FileHeader, R: ReadRef<'data>> SymbolTable<'data, Elf, R> {
pub fn symbol_section(
&self,
endian: Elf::Endian,
symbol: &'data Elf::Sym,
symbol: &Elf::Sym,
index: usize,
) -> read::Result<Option<SectionIndex>> {
match symbol.st_shndx(endian) {
Expand All @@ -177,11 +177,7 @@ impl<'data, Elf: FileHeader, R: ReadRef<'data>> SymbolTable<'data, Elf, R> {
}

/// Return the symbol name for the given symbol.
pub fn symbol_name(
&self,
endian: Elf::Endian,
symbol: &'data Elf::Sym,
) -> read::Result<&'data [u8]> {
pub fn symbol_name(&self, endian: Elf::Endian, symbol: &Elf::Sym) -> read::Result<&'data [u8]> {
symbol.name(endian, self.strings)
}

Expand Down

0 comments on commit 0643b61

Please sign in to comment.