Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncomment None constant #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kinseytamsin
Copy link

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.

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.
@kinseytamsin kinseytamsin marked this pull request as ready for review January 24, 2020 19:21
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.
@kinseytamsin
Copy link
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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants