Uncomment None constant#110
Open
kinseytamsin wants to merge 2 commits intoAltF02:masterfrom
Open
Conversation
I'm assuming this was commented out to avoid shadowing `std::option::Option::None`. However, aside from the fact that this essentially excludes a symbol from the library bindings that should be included, this is really not necessary. There are other ways for client code to avoid this issue, such as avoiding importing `x11::xlib::*` or re-exporting either `std::option::Option::None` or `x11::xlib::None` under a different name.
If simply restored as-is, the `None` constant may break existing code that imports `x11::xlib::*` and expects `None` to refer to `std::option::Option::None`. Gate the declaration behind a feature that is not enabled by default to prevent this.
Author
|
I talked to a friend of mine about this pull request and realized that my first commit is potentially a dangerous change for existing code. Commit 35bcddc is an attempt to address this and make this PR mergeable without a major version bump (per SemVer requirements). Perhaps if this is merged then the feature-gating can be removed in 3.0.0. |
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.
I'm assuming this was commented out to avoid shadowing
std::option::Option::None. However, aside from the fact that thisessentially excludes a symbol from the library bindings that should be
included, this is really not necessary. There are other ways for client
code to avoid this issue, such as avoiding importing
x11::xlib::*orre-exporting either
std::option::Option::Noneorx11::xlib::Noneunder a different name.