File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -216,8 +216,7 @@ fn rewrite_macro_inner(
216
216
let ts = mac. args . tokens . clone ( ) ;
217
217
let has_comment = contains_comment ( context. snippet ( mac. span ( ) ) ) ;
218
218
if ts. is_empty ( ) && !has_comment {
219
- return (
220
- match style {
219
+ let rewrite = match style {
221
220
Delimiter :: Parenthesis if position == MacroPosition :: Item => {
222
221
Some ( format ! ( "{macro_name}();" ) )
223
222
}
@@ -228,13 +227,8 @@ fn rewrite_macro_inner(
228
227
Delimiter :: Bracket => Some ( format ! ( "{macro_name}[]" ) ) ,
229
228
Delimiter :: Brace => Some ( format ! ( "{macro_name} {{}}" ) ) ,
230
229
_ => unreachable ! ( ) ,
231
- } ,
232
- if original_style != style {
233
- Some ( style)
234
- } else {
235
- None
236
- } ,
237
- ) ;
230
+ } ;
231
+ return ( rewrite, Some ( style) ) ;
238
232
}
239
233
// Format well-known macros which cannot be parsed as a valid AST.
240
234
if macro_name == "lazy_static!" && !has_comment {
You can’t perform that action at this time.
0 commit comments