From d20446111167b6cddb0ec28a37bf7f194359eac4 Mon Sep 17 00:00:00 2001 From: Philip Craig Date: Wed, 8 May 2024 00:00:00 +0000 Subject: [PATCH] read/elf: remove unneeded lifetimes (#681) While these should be true in practice, they aren't needed, and their presence may require callers to annotate them too. --- src/read/elf/section.rs | 2 +- src/read/elf/symbol.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/read/elf/section.rs b/src/read/elf/section.rs index 7368e2b9..eaf7277d 100644 --- a/src/read/elf/section.rs +++ b/src/read/elf/section.rs @@ -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) } diff --git a/src/read/elf/symbol.rs b/src/read/elf/symbol.rs index 1edf90f4..4dbf823a 100644 --- a/src/read/elf/symbol.rs +++ b/src/read/elf/symbol.rs @@ -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> { match symbol.st_shndx(endian) { @@ -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) }