@@ -182,18 +182,10 @@ fn check_inline(cx: &LateContext<'_>, param: &FormatParam<'_>, inline_spans: &mu
182
182
&& let Path { span, segments, .. } = path
183
183
&& let [ segment] = segments
184
184
{
185
- // TODO: Note the inconsistency here, that we may want to address separately:
186
- // implicit, numbered, and starred `param.span` spans the whole relevant string:
187
- // the empty space between `{}`, or the entire value `1$`, `.2$`, or `.*`
188
- // but the named argument spans just the name itself, without the surrounding `.` and `$`.
189
- let replacement = if param. kind == Numbered || param. kind == Starred {
190
- match param. usage {
191
- FormatParamUsage :: Argument => segment. ident . name . to_string ( ) ,
192
- FormatParamUsage :: Width => format ! ( "{}$" , segment. ident. name) ,
193
- FormatParamUsage :: Precision => format ! ( ".{}$" , segment. ident. name) ,
194
- }
195
- } else {
196
- segment. ident . name . to_string ( )
185
+ let replacement = match param. usage {
186
+ FormatParamUsage :: Argument => segment. ident . name . to_string ( ) ,
187
+ FormatParamUsage :: Width => format ! ( "{}$" , segment. ident. name) ,
188
+ FormatParamUsage :: Precision => format ! ( ".{}$" , segment. ident. name) ,
197
189
} ;
198
190
inline_spans. push ( ( param. span , replacement) ) ;
199
191
let arg_span = expand_past_previous_comma ( cx, * span) ;
0 commit comments