Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc committed Dec 1, 2024
1 parent 36eda2b commit 01c8b19
Show file tree
Hide file tree
Showing 7 changed files with 350 additions and 70 deletions.
60 changes: 50 additions & 10 deletions src/read/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,56 @@ impl<'data, R> Object<'data> for File<'data, R>
where
R: ReadRef<'data>,
{
type Segment<'file> = Segment<'data, 'file, R> where Self: 'file, 'data: 'file;
type SegmentIterator<'file> = SegmentIterator<'data, 'file, R> where Self: 'file, 'data: 'file;
type Section<'file> = Section<'data, 'file, R> where Self: 'file, 'data: 'file;
type SectionIterator<'file> = SectionIterator<'data, 'file, R> where Self: 'file, 'data: 'file;
type Comdat<'file> = Comdat<'data, 'file, R> where Self: 'file, 'data: 'file;
type ComdatIterator<'file> = ComdatIterator<'data, 'file, R> where Self: 'file, 'data: 'file;
type Symbol<'file> = Symbol<'data, 'file, R> where Self: 'file, 'data: 'file;
type SymbolIterator<'file> = SymbolIterator<'data, 'file, R> where Self: 'file, 'data: 'file;
type SymbolTable<'file> = SymbolTable<'data, 'file, R> where Self: 'file, 'data: 'file;
type DynamicRelocationIterator<'file> = DynamicRelocationIterator<'data, 'file, R> where Self: 'file, 'data: 'file;
type Segment<'file>
= Segment<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type SegmentIterator<'file>
= SegmentIterator<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type Section<'file>
= Section<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type SectionIterator<'file>
= SectionIterator<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type Comdat<'file>
= Comdat<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type ComdatIterator<'file>
= ComdatIterator<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type Symbol<'file>
= Symbol<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type SymbolIterator<'file>
= SymbolIterator<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type SymbolTable<'file>
= SymbolTable<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type DynamicRelocationIterator<'file>
= DynamicRelocationIterator<'data, 'file, R>
where
Self: 'file,
'data: 'file;

fn architecture(&self) -> Architecture {
with_inner!(self, File, |x| x.architecture())
Expand Down
60 changes: 50 additions & 10 deletions src/read/coff/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,56 @@ where
R: ReadRef<'data>,
Coff: CoffHeader,
{
type Segment<'file> = CoffSegment<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type SegmentIterator<'file> = CoffSegmentIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type Section<'file> = CoffSection<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type SectionIterator<'file> = CoffSectionIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type Comdat<'file> = CoffComdat<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type ComdatIterator<'file> = CoffComdatIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type Symbol<'file> = CoffSymbol<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type SymbolIterator<'file> = CoffSymbolIterator<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type SymbolTable<'file> = CoffSymbolTable<'data, 'file, R, Coff> where Self: 'file, 'data: 'file;
type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file;
type Segment<'file>
= CoffSegment<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type SegmentIterator<'file>
= CoffSegmentIterator<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type Section<'file>
= CoffSection<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type SectionIterator<'file>
= CoffSectionIterator<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type Comdat<'file>
= CoffComdat<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type ComdatIterator<'file>
= CoffComdatIterator<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type Symbol<'file>
= CoffSymbol<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type SymbolIterator<'file>
= CoffSymbolIterator<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type SymbolTable<'file>
= CoffSymbolTable<'data, 'file, R, Coff>
where
Self: 'file,
'data: 'file;
type DynamicRelocationIterator<'file>
= NoDynamicRelocationIterator
where
Self: 'file,
'data: 'file;

fn architecture(&self) -> Architecture {
match self.header.machine() {
Expand Down
60 changes: 50 additions & 10 deletions src/read/elf/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,56 @@ where
Elf: FileHeader,
R: ReadRef<'data>,
{
type Segment<'file> = ElfSegment<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type SegmentIterator<'file> = ElfSegmentIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type Section<'file> = ElfSection<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type SectionIterator<'file> = ElfSectionIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type Comdat<'file> = ElfComdat<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type ComdatIterator<'file> = ElfComdatIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type Symbol<'file> = ElfSymbol<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type SymbolIterator<'file> = ElfSymbolIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type SymbolTable<'file> = ElfSymbolTable<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type DynamicRelocationIterator<'file> = ElfDynamicRelocationIterator<'data, 'file, Elf, R> where Self: 'file, 'data: 'file;
type Segment<'file>
= ElfSegment<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type SegmentIterator<'file>
= ElfSegmentIterator<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type Section<'file>
= ElfSection<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type SectionIterator<'file>
= ElfSectionIterator<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type Comdat<'file>
= ElfComdat<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type ComdatIterator<'file>
= ElfComdatIterator<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type Symbol<'file>
= ElfSymbol<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type SymbolIterator<'file>
= ElfSymbolIterator<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type SymbolTable<'file>
= ElfSymbolTable<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;
type DynamicRelocationIterator<'file>
= ElfDynamicRelocationIterator<'data, 'file, Elf, R>
where
Self: 'file,
'data: 'file;

fn architecture(&self) -> Architecture {
match (
Expand Down
60 changes: 50 additions & 10 deletions src/read/macho/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,56 @@ where
Mach: MachHeader,
R: ReadRef<'data>,
{
type Segment<'file> = MachOSegment<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type SegmentIterator<'file> = MachOSegmentIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type Section<'file> = MachOSection<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type SectionIterator<'file> = MachOSectionIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type Comdat<'file> = MachOComdat<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type ComdatIterator<'file> = MachOComdatIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type Symbol<'file> = MachOSymbol<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type SymbolIterator<'file> = MachOSymbolIterator<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type SymbolTable<'file> = MachOSymbolTable<'data, 'file, Mach, R> where Self: 'file, 'data: 'file;
type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file;
type Segment<'file>
= MachOSegment<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type SegmentIterator<'file>
= MachOSegmentIterator<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type Section<'file>
= MachOSection<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type SectionIterator<'file>
= MachOSectionIterator<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type Comdat<'file>
= MachOComdat<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type ComdatIterator<'file>
= MachOComdatIterator<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type Symbol<'file>
= MachOSymbol<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type SymbolIterator<'file>
= MachOSymbolIterator<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type SymbolTable<'file>
= MachOSymbolTable<'data, 'file, Mach, R>
where
Self: 'file,
'data: 'file;
type DynamicRelocationIterator<'file>
= NoDynamicRelocationIterator
where
Self: 'file,
'data: 'file;

fn architecture(&self) -> Architecture {
match self.header.cputype(self.endian) {
Expand Down
60 changes: 50 additions & 10 deletions src/read/pe/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,56 @@ where
Pe: ImageNtHeaders,
R: ReadRef<'data>,
{
type Segment<'file> = PeSegment<'data, 'file, Pe, R> where Self: 'file, 'data: 'file;
type SegmentIterator<'file> = PeSegmentIterator<'data, 'file, Pe, R> where Self: 'file, 'data: 'file;
type Section<'file> = PeSection<'data, 'file, Pe, R> where Self: 'file, 'data: 'file;
type SectionIterator<'file> = PeSectionIterator<'data, 'file, Pe, R> where Self: 'file, 'data: 'file;
type Comdat<'file> = PeComdat<'data, 'file, Pe, R> where Self: 'file, 'data: 'file;
type ComdatIterator<'file> = PeComdatIterator<'data, 'file, Pe, R> where Self: 'file, 'data: 'file;
type Symbol<'file> = CoffSymbol<'data, 'file, R> where Self: 'file, 'data: 'file;
type SymbolIterator<'file> = CoffSymbolIterator<'data, 'file, R> where Self: 'file, 'data: 'file;
type SymbolTable<'file> = CoffSymbolTable<'data, 'file, R> where Self: 'file, 'data: 'file;
type DynamicRelocationIterator<'file> = NoDynamicRelocationIterator where Self: 'file, 'data: 'file;
type Segment<'file>
= PeSegment<'data, 'file, Pe, R>
where
Self: 'file,
'data: 'file;
type SegmentIterator<'file>
= PeSegmentIterator<'data, 'file, Pe, R>
where
Self: 'file,
'data: 'file;
type Section<'file>
= PeSection<'data, 'file, Pe, R>
where
Self: 'file,
'data: 'file;
type SectionIterator<'file>
= PeSectionIterator<'data, 'file, Pe, R>
where
Self: 'file,
'data: 'file;
type Comdat<'file>
= PeComdat<'data, 'file, Pe, R>
where
Self: 'file,
'data: 'file;
type ComdatIterator<'file>
= PeComdatIterator<'data, 'file, Pe, R>
where
Self: 'file,
'data: 'file;
type Symbol<'file>
= CoffSymbol<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type SymbolIterator<'file>
= CoffSymbolIterator<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type SymbolTable<'file>
= CoffSymbolTable<'data, 'file, R>
where
Self: 'file,
'data: 'file;
type DynamicRelocationIterator<'file>
= NoDynamicRelocationIterator
where
Self: 'file,
'data: 'file;

fn architecture(&self) -> Architecture {
match self.nt_headers.file_header().machine.get(LE) {
Expand Down
Loading

0 comments on commit 01c8b19

Please sign in to comment.