forked from toml-rs/toml
-
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.
60: Replace Cell and RefCell usage in display.rs r=ordian a=alsuren I also split the implementation into a helper method that can walk a tree of tables, and a callback that does the formatting. Currently, I use a closure to pass the Formatter into the callback, which feels a bit naughty. A cleaner implementation might be to implement the full visitor pattern with a struct, but I get in trouble with lifetimes whenever I store a reference to the Formatter anywhere. The eventual plan is to create `Table::visit_nested_tables_in_original_order()` and `Document::to_string_in_original_order()` (or similar), to solve killercup/cargo-edit#218 . That PR is still a bit of a mess though, so I've extracted this bit to get the ball rolling. Tell me what you think. Co-authored-by: David Laban <[email protected]>
- Loading branch information
Showing
1 changed file
with
50 additions
and
39 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