forked from rust-lang/rustfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reuse
rewrite_static
when formatting foreign static items
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.
- Loading branch information
Showing
2 changed files
with
27 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
extern "C" { | ||
static TEST: i32 = 42; | ||
} |