Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions multiboot2/src/elf_sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl ElfSectionsTag {
/// Returns the string table data, if it's present.
#[must_use]
pub fn string_table(&self) -> Option<&[u8]> {
let shdr_table: SectionHeaderTable<NativeEndian> = self.into();
let shdr_table = SectionHeaderTable::new(NativeEndian, self.class(), &self.sections);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @an-owl - I think the From impl was not very idiomatic Rust. I decided to switch back to a normal constructor.

Nevertheless: thanks for your contribution!


// Info for this here
// https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-43405.html @ `e_shstrndx`
Expand Down Expand Up @@ -106,12 +106,6 @@ impl ElfSectionsTag {
}
}

impl<'a> From<&'a ElfSectionsTag> for SectionHeaderTable<'a, NativeEndian> {
fn from(value: &'a ElfSectionsTag) -> Self {
SectionHeaderTable::new(NativeEndian, value.class(), &value.sections)
}
}

impl MaybeDynSized for ElfSectionsTag {
type Header = TagHeader;

Expand Down