Skip to content

Commit a42faa5

Browse files
committed
Clean up a little redundancy
1 parent 94c0faf commit a42faa5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/macros.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -296,20 +296,19 @@ fn rewrite_macro_inner(
296296
// If we are rewriting `vec!` macro or other special macros,
297297
// then we can rewrite this as a usual array literal.
298298
// Otherwise, we must preserve the original existence of trailing comma.
299-
let macro_name = &macro_name.as_str();
300299
let mut force_trailing_comma = if trailing_comma {
301300
Some(SeparatorTactic::Always)
302301
} else {
303302
Some(SeparatorTactic::Never)
304303
};
305-
if FORCED_BRACKET_MACROS.contains(macro_name) && !is_nested_macro {
304+
if is_forced_bracket && !is_nested_macro {
306305
context.leave_macro();
307306
if context.use_block_indent() {
308307
force_trailing_comma = Some(SeparatorTactic::Vertical);
309308
};
310309
}
311310
let rewrite = rewrite_array(
312-
macro_name,
311+
&macro_name,
313312
arg_vec.iter(),
314313
mac.span(),
315314
context,

0 commit comments

Comments
 (0)