Fix up README example so it compiles

Patch 9a6a265a forgot to update the old name of find_common_sections in the README, and since cargo test only compiles doc comments and
doesn't know about the README, I missed this.

Fixes #31
This commit is contained in:
Christopher Cole 2023-02-20 18:26:36 -08:00
parent c2799a1d75
commit 2ad70e5db2
No known key found for this signature in database
GPG Key ID: 0AC856975983E9DB
2 changed files with 1 additions and 3 deletions

View File

@ -93,7 +93,6 @@ Release-target compilation times on this developer's 2021 m1 macbook are sub-sec
```rust ```rust
use elf::ElfBytes; use elf::ElfBytes;
use elf::endian::AnyEndian; use elf::endian::AnyEndian;
use elf::hash::sysv_hash;
use elf::note::Note; use elf::note::Note;
use elf::note::NoteGnuBuildId; use elf::note::NoteGnuBuildId;
use elf::section::SectionHeader; use elf::section::SectionHeader;
@ -121,7 +120,7 @@ assert_eq!(
); );
// Find lazy-parsing types for the common ELF sections (we want .dynsym, .dynstr, .hash) // Find lazy-parsing types for the common ELF sections (we want .dynsym, .dynstr, .hash)
let common = file.find_common_sections().expect("shdrs should parse"); let common = file.find_common_data().expect("shdrs should parse");
let (dynsyms, strtab) = (common.dynsyms.unwrap(), common.dynsyms_strs.unwrap()); let (dynsyms, strtab) = (common.dynsyms.unwrap(), common.dynsyms_strs.unwrap());
let hash_table = common.sysv_hash.unwrap(); let hash_table = common.sysv_hash.unwrap();

View File

@ -83,7 +83,6 @@
//! ``` //! ```
//! use elf::ElfBytes; //! use elf::ElfBytes;
//! use elf::endian::AnyEndian; //! use elf::endian::AnyEndian;
//! use elf::hash::sysv_hash;
//! use elf::note::Note; //! use elf::note::Note;
//! use elf::note::NoteGnuBuildId; //! use elf::note::NoteGnuBuildId;
//! use elf::section::SectionHeader; //! use elf::section::SectionHeader;