@@ -949,9 +949,9 @@ impl EmitterWriter {
949
949
// | | |
950
950
// | | something about `foo`
951
951
// | something about `fn foo()`
952
- annotations_position. sort_by_key ( |x | {
953
- // Decreasing order. When `a` and `b` are the same length, prefer `Primary`.
954
- ( Reverse ( a . 1 . len ( ) ) , a . 1 . is_primary )
952
+ annotations_position. sort_by_key ( |( _ , ann ) | {
953
+ // Decreasing order. When annotations share the same length, prefer `Primary`.
954
+ ( Reverse ( ann . len ( ) ) , ann . is_primary )
955
955
} ) ;
956
956
957
957
// Write the underlines.
@@ -1006,14 +1006,14 @@ impl EmitterWriter {
1006
1006
for primary_span in msp. primary_spans ( ) {
1007
1007
if !primary_span. is_dummy ( ) {
1008
1008
let hi = sm. lookup_char_pos ( primary_span. hi ( ) ) ;
1009
- max = max ( max , hi. line ) ;
1009
+ max = ( hi. line ) . max ( max ) ;
1010
1010
}
1011
1011
}
1012
1012
if !self . short_message {
1013
1013
for span_label in msp. span_labels ( ) {
1014
1014
if !span_label. span . is_dummy ( ) {
1015
1015
let hi = sm. lookup_char_pos ( span_label. span . hi ( ) ) ;
1016
- max = max ( max , hi. line ) ;
1016
+ max = ( hi. line ) . max ( max ) ;
1017
1017
}
1018
1018
}
1019
1019
}
@@ -1057,9 +1057,9 @@ impl EmitterWriter {
1057
1057
let padding = " " . repeat ( padding + label. len ( ) + 5 ) ;
1058
1058
1059
1059
/// Returns `override` if it is present and `style` is `NoStyle` or `style` otherwise
1060
- fn style_or_override ( style : Style , override : Option < Style > ) -> Style {
1061
- match ( style, override ) {
1062
- ( Style :: NoStyle , Some ( override ) ) => override ,
1060
+ fn style_or_override ( style : Style , override_ : Option < Style > ) -> Style {
1061
+ match ( style, override_ ) {
1062
+ ( Style :: NoStyle , Some ( override_ ) ) => override_ ,
1063
1063
_ => style,
1064
1064
}
1065
1065
}
@@ -1297,7 +1297,7 @@ impl EmitterWriter {
1297
1297
for line in & annotated_file. lines {
1298
1298
max_line_len = max ( max_line_len, annotated_file. file
1299
1299
. get_line ( line. line_index - 1 )
1300
- . map_or ( 0 , |s| s. len ( ) ) ;
1300
+ . map_or ( 0 , |s| s. len ( ) ) ) ;
1301
1301
for ann in & line. annotations {
1302
1302
span_right_margin = max ( span_right_margin, ann. start_col ) ;
1303
1303
span_right_margin = max ( span_right_margin, ann. end_col ) ;
@@ -1525,7 +1525,7 @@ impl EmitterWriter {
1525
1525
1526
1526
// length of the code after substitution
1527
1527
let full_sub_len = part. snippet . chars ( )
1528
- . map ( |ch| acc + unicode_width:: UnicodeWidthChar :: width ( ch) . unwrap_or ( 1 ) )
1528
+ . map ( |ch| unicode_width:: UnicodeWidthChar :: width ( ch) . unwrap_or ( 1 ) )
1529
1529
. sum ( ) as isize ;
1530
1530
1531
1531
// length of the code to be substituted
0 commit comments