File tree 1 file changed +16
-16
lines changed
1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -997,27 +997,27 @@ impl EmitterWriter {
997
997
}
998
998
999
999
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
+
1000
1005
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 ) ;
1009
1010
}
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 ) ;
1018
1017
}
1019
1018
}
1020
1019
}
1020
+
1021
1021
max
1022
1022
}
1023
1023
You can’t perform that action at this time.
0 commit comments