Skip to content

Uncomment None constant#110

Open
kinseytamsin wants to merge 2 commits intoAltF02:masterfrom
kinseytamsin:none-symbol
Open

Uncomment None constant#110
kinseytamsin wants to merge 2 commits intoAltF02:masterfrom
kinseytamsin:none-symbol

Conversation

@kinseytamsin
Copy link
Copy Markdown

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
Copy Markdown
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.

2 participants