Skip to content

Add a feature to use Display as Decimal's Debug output#48

Open
shuoli84 wants to merge 2 commits intoneogenie:masterfrom
shuoli84:master
Open

Add a feature to use Display as Decimal's Debug output#48
shuoli84 wants to merge 2 commits intoneogenie:masterfrom
shuoli84:master

Conversation

@shuoli84
Copy link

As a user, the default Debug impl is hard to reason, so I add a feature to let client switch to human friendlier debug output.

@neogenie
Copy link
Owner

Thank you for the feedback and participation in the project!

I don't think it's worth using the features’ mechanism for these purposes, as it will create issues during use of --all-features.

The first thing that comes to mind is to use compile-time variables, where some display parameters are already configured.

Also, for these purposes, we can use Debug (:?) and Alternate Debug (:#?), for example, in combination with a compile-time flag (when the flag is set, one of the above-mentioned placeholders replaces Debug output with Display).

@shuoli84
Copy link
Author

Yes, you are right. the feature flag is not pure additive, which makes it tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants