-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…2559) This PR moves the shared traits `Format`, `Formatter`, `IntoFormatElement`, and the extension traits to `rome_formatter`. I introduce two new traits to work around Rust's orphan rule. * `AsFormat`: Has a single `format()` method that returns an object that knows how to format `self` (by reference) * `IntoFormat`: Has a single `into_format()` that returns an object that knows how to format `self` (takes ownership) An object that isn't able to implement `Format` itself because of Rust's orphan rule can implement `AsFormat` and `IntoFormat`. This PR changes the node formatting by making them implement `AsFormat` and `IntoFormat` instead of implementing `Format`. The formatting is implemented by a `Format*` new-type that has a single static `::format` method. This new type has been necessary to have a way to share the formatting logic between `AsFormat` and `IntoFormat`.
- Loading branch information
1 parent
ff5a3d5
commit e6409b8
Showing
427 changed files
with
11,672 additions
and
5,390 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.