File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -251,9 +251,13 @@ fn format_args_expand(
251251 }
252252 for arg in & mut args {
253253 // Remove `key =`.
254- if matches ! ( arg. token_trees. get( 1 ) , Some ( tt:: TokenTree :: Leaf ( tt:: Leaf :: Punct ( p) ) ) if p. char == '=' && p . spacing != tt :: Spacing :: Joint )
254+ if matches ! ( arg. token_trees. get( 1 ) , Some ( tt:: TokenTree :: Leaf ( tt:: Leaf :: Punct ( p) ) ) if p. char == '=' )
255255 {
256- arg. token_trees . drain ( ..2 ) ;
256+ // but not with `==`
257+ if !matches ! ( arg. token_trees. get( 2 ) , Some ( tt:: TokenTree :: Leaf ( tt:: Leaf :: Punct ( p) ) ) if p. char == '=' )
258+ {
259+ arg. token_trees . drain ( ..2 ) ;
260+ }
257261 }
258262 }
259263 let _format_string = args. remove ( 0 ) ;
Original file line number Diff line number Diff line change @@ -228,16 +228,7 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
228228 }
229229
230230 let spacing = match conv. peek ( ) . map ( |next| next. kind ( conv) ) {
231- Some ( kind)
232- if !kind. is_trivia ( )
233- && kind. is_punct ( )
234- && kind != T ! [ '[' ]
235- && kind != T ! [ '{' ]
236- && kind != T ! [ '(' ]
237- && kind != UNDERSCORE =>
238- {
239- tt:: Spacing :: Joint
240- }
231+ Some ( kind) if !kind. is_trivia ( ) => tt:: Spacing :: Joint ,
241232 _ => tt:: Spacing :: Alone ,
242233 } ;
243234 let char = match token. to_char ( conv) {
You can’t perform that action at this time.
0 commit comments