@@ -43,9 +43,8 @@ impl ElfSectionsTag {
43
43
/// ```
44
44
pub fn sections ( & self ) -> ElfSectionIter {
45
45
let string_section_offset = ( self . get ( ) . shndx * self . get ( ) . entry_size ) as isize ;
46
- let string_section_ptr = unsafe {
47
- self . first_section ( ) . offset ( string_section_offset) as * const _
48
- } ;
46
+ let string_section_ptr =
47
+ unsafe { self . first_section ( ) . offset ( string_section_offset) as * const _ } ;
49
48
ElfSectionIter {
50
49
current_section : self . first_section ( ) ,
51
50
remaining_sections : self . get ( ) . number_of_sections ,
@@ -152,8 +151,8 @@ impl ElfSection {
152
151
9 => ElfSectionType :: RelRelocation ,
153
152
10 => ElfSectionType :: Reserved ,
154
153
11 => ElfSectionType :: DynamicLoaderSymbolTable ,
155
- 0x6000_0000 ... 0x6FFF_FFFF => ElfSectionType :: EnvironmentSpecific ,
156
- 0x7000_0000 ... 0x7FFF_FFFF => ElfSectionType :: ProcessorSpecific ,
154
+ 0x6000_0000 ..= 0x6FFF_FFFF => ElfSectionType :: EnvironmentSpecific ,
155
+ 0x7000_0000 ..= 0x7FFF_FFFF => ElfSectionType :: ProcessorSpecific ,
157
156
_ => panic ! ( ) ,
158
157
}
159
158
}
@@ -165,11 +164,9 @@ impl ElfSection {
165
164
166
165
/// Read the name of the section.
167
166
pub fn name ( & self ) -> & str {
168
- use core:: { str , slice } ;
167
+ use core:: { slice , str } ;
169
168
170
- let name_ptr = unsafe {
171
- self . string_table ( ) . offset ( self . get ( ) . name_index ( ) as isize )
172
- } ;
169
+ let name_ptr = unsafe { self . string_table ( ) . offset ( self . get ( ) . name_index ( ) as isize ) } ;
173
170
let strlen = {
174
171
let mut len = 0 ;
175
172
while unsafe { * name_ptr. offset ( len) } != 0 {
@@ -218,7 +215,7 @@ impl ElfSection {
218
215
self . flags ( ) . contains ( ElfSectionFlags :: ALLOCATED )
219
216
}
220
217
221
- fn get ( & self ) -> & ElfSectionInner {
218
+ fn get ( & self ) -> & dyn ElfSectionInner {
222
219
match self . entry_size {
223
220
40 => unsafe { & * ( self . inner as * const ElfSectionInner32 ) } ,
224
221
64 => unsafe { & * ( self . inner as * const ElfSectionInner64 ) } ,
0 commit comments