File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -346,15 +346,14 @@ fn line_info(obj_file: &File<'_>, sections: &mut [ObjSection]) -> Result<()> {
346
346
if row. end_sequence ( ) {
347
347
// The next row is the start of a new sequence, which means we must
348
348
// advance to the next .text section.
349
- let section_index = text_sections
350
- . next ( )
351
- . ok_or_else ( || anyhow ! ( "Next text section not found for line info" ) ) ?
352
- . index ( )
353
- . 0 ;
354
- lines = sections
355
- . iter_mut ( )
356
- . find ( |s| s. orig_index == section_index)
357
- . map ( |s| & mut s. line_info ) ;
349
+ let section_index = text_sections. next ( ) . map ( |s| s. index ( ) . 0 ) ;
350
+ lines = section_index. map ( |index| {
351
+ & mut sections
352
+ . iter_mut ( )
353
+ . find ( |s| s. orig_index == index)
354
+ . unwrap ( )
355
+ . line_info
356
+ } ) ;
358
357
}
359
358
}
360
359
}
You can’t perform that action at this time.
0 commit comments