File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -334,3 +334,26 @@ impl SectionBuilder {
334334 }
335335 }
336336}
337+
338+ impl < T : AsRef < Section > > From < T > for SectionBuilder {
339+ fn from ( value : T ) -> Self {
340+ let value = value. as_ref ( ) ;
341+ let name = value. name ( ) . to_string_lossy ( ) . to_string ( ) ;
342+ let ty = value. section_type ( ) . to_string ( ) ;
343+ let linked_section = value. linked_section ( ) . to_string_lossy ( ) . to_string ( ) ;
344+ let info_section = value. info_section ( ) . to_string_lossy ( ) . to_string ( ) ;
345+
346+ Self {
347+ is_auto : value. auto_defined ( ) ,
348+ name,
349+ range : value. address_range ( ) ,
350+ semantics : value. semantics ( ) ,
351+ ty,
352+ align : value. align ( ) ,
353+ entry_size : value. entry_size ( ) as u64 ,
354+ linked_section,
355+ info_section,
356+ info_data : value. info_data ( ) ,
357+ }
358+ }
359+ }
You can’t perform that action at this time.
0 commit comments