File tree 1 file changed +5
-7
lines changed
compiler/rustc_builtin_macros/src
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -81,21 +81,19 @@ impl PositionalNamedArg {
81
81
// For the message span, if there is formatting, we want to use the opening `{` and the
82
82
// next character, which will the `:` indicating the start of formatting. If there is
83
83
// not any formatting, we want to underline the entire span.
84
- if self . has_formatting {
85
- cx . arg_spans . get ( self . cur_piece ) . map_or ( ( None , None ) , |arg_span| {
84
+ cx . arg_spans . get ( self . cur_piece ) . map_or ( ( None , None ) , |arg_span| {
85
+ if self . has_formatting {
86
86
(
87
87
Some ( arg_span. with_lo ( arg_span. lo ( ) + BytePos ( 1 ) ) . shrink_to_lo ( ) ) ,
88
88
Some ( arg_span. with_hi ( arg_span. lo ( ) + BytePos ( 2 ) ) ) ,
89
89
)
90
- } )
91
- } else {
92
- cx. arg_spans . get ( self . cur_piece ) . map_or ( ( None , None ) , |arg_span| {
90
+ } else {
93
91
let replace_start = arg_span. lo ( ) + BytePos ( 1 ) ;
94
92
let replace_end = arg_span. hi ( ) - BytePos ( 1 ) ;
95
93
let to_replace = arg_span. with_lo ( replace_start) . with_hi ( replace_end) ;
96
94
( Some ( to_replace) , Some ( * arg_span) )
97
- } )
98
- }
95
+ }
96
+ } )
99
97
} else {
100
98
( None , None )
101
99
}
You can’t perform that action at this time.
0 commit comments