-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate fmt to use Display trait (#44)
Migrate fmt to use Display trait to simplify the usage of it. Also with this, in the same snipped of code we can print types from backend, middleware and frontend; which before needed to import the two different `Printer` structs (frontend::Printer and mock_main::Printer). Before: ``` let printer = mock_main::Printer { skip_none: false }; let mut w = io::stdout(); printer.fmt_mock_main_pod(&mut w, &pod).unwrap(); let printer = frontend::Printer { skip_none: false }; printer.fmt_main_pod_builder(&mut w, &pod_builder).unwrap(); ``` now: ``` println!("{:#}", pod); println!("{:#}", pod_builder); ``` And the equivalent to the old `skip_none: true`, now is done by just using `println!("{}", pod);
- Loading branch information
Showing
3 changed files
with
176 additions
and
173 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
Oops, something went wrong.