Hide helper traits from calling code#7
Merged
yaahc merged 4 commits intoyaahc:masterfrom Nov 10, 2019
Merged
Conversation
Makes a couple of changes to avoid helper traits from appearing anywhere in the caller code. It changes the name of the `Display` trait method to reduce the chance that an inherent method conflicts with the type in question, causing undesirable results. It also wraps the helper trait and declarations into an anonymous const context, meaning the helper traits aren't visible to the calling context.
Contributor
Author
|
I didn't realize that this crate has a minimum supported rustc version of 1.31. The anonymous If we want to continue to support earlier rustc versions, we'll need to take a similar approach to FYI, it appears as though CI isn't currently set to run on PRs, only on pushes, so this PR isn't noted as failing despite the minimum version being tested. |
Owner
|
Ill set it up to run on prs, I think I'd prefer to keep supporting 1.31 but I'm open to bumping the MSRV |
yaahc
approved these changes
Nov 10, 2019
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes the name of the
Displaytrait method to reduce the chance that an inherent method conflicts with the type in question, and wraps the helper trait and declarations into an anonymous const context, meaning the helper traits aren't visible to the calling context.