rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

reuse `rewrite_static` when formatting foreign static items

Open ytmimi opened this issue 1 year ago • 0 comments

fixes #6267

The ForeignItemKind::Static(_) match arm in the ast::ForeignItem Rewrite impl duplicated some of the logic already implemented in rewrite_static, so reusing it helps centralize the logic.

The other benefit to using rewrite_static is that it already supports rewriting the rhs of a static assignment.

ytmimi avatar Aug 04 '24 23:08 ytmimi