File tree Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -997,27 +997,27 @@ impl EmitterWriter {
997997 }
998998
999999 fn get_multispan_max_line_num ( & mut self , msp : & MultiSpan ) -> usize {
1000+ let sm = match self . sm {
1001+ Some ( ref sm) => sm,
1002+ None => return 0 ,
1003+ } ;
1004+
10001005 let mut max = 0 ;
1001- if let Some ( ref sm) = self . sm {
1002- for primary_span in msp. primary_spans ( ) {
1003- if !primary_span. is_dummy ( ) {
1004- let hi = sm. lookup_char_pos ( primary_span. hi ( ) ) ;
1005- if hi. line > max {
1006- max = hi. line ;
1007- }
1008- }
1006+ for primary_span in msp. primary_spans ( ) {
1007+ if !primary_span. is_dummy ( ) {
1008+ let hi = sm. lookup_char_pos ( primary_span. hi ( ) ) ;
1009+ max = max ( max, hi. line ) ;
10091010 }
1010- if !self . short_message {
1011- for span_label in msp. span_labels ( ) {
1012- if !span_label. span . is_dummy ( ) {
1013- let hi = sm. lookup_char_pos ( span_label. span . hi ( ) ) ;
1014- if hi. line > max {
1015- max = hi. line ;
1016- }
1017- }
1011+ }
1012+ if !self . short_message {
1013+ for span_label in msp. span_labels ( ) {
1014+ if !span_label. span . is_dummy ( ) {
1015+ let hi = sm. lookup_char_pos ( span_label. span . hi ( ) ) ;
1016+ max = max ( max, hi. line ) ;
10181017 }
10191018 }
10201019 }
1020+
10211021 max
10221022 }
10231023
You can’t perform that action at this time.
0 commit comments