-
Notifications
You must be signed in to change notification settings - Fork 449
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
Expand selectors as hex-encoded literals in metadata #927
Conversation
Codecov Report
@@ Coverage Diff @@
## master #927 +/- ##
==========================================
+ Coverage 84.24% 84.31% +0.07%
==========================================
Files 172 173 +1
Lines 7945 7958 +13
==========================================
+ Hits 6693 6710 +17
+ Misses 1252 1248 -4
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about the pattern used, but code/tests look good
mod private { | ||
/// Used to prevent external direct usage of `HexLiteral::hex_impl_`. | ||
pub struct Sealed; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe how this pattern works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Sealed
type is inaccessible from the outside therefore one cannot provide it (in safe Rust) as parameter for the hidden method and therefore we protect to call it from outside the default trait methods using the Rust type system.
Extracted from work in done in #665.
Using the utilities provided in this PR we can also use hex-encoded literals elsewhere in our macro expansion.