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

Expand selectors as hex-encoded literals in metadata #927

Merged
merged 5 commits into from
Sep 20, 2021

Conversation

Robbepop
Copy link
Collaborator

@Robbepop Robbepop commented Sep 19, 2021

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.

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2021

Codecov Report

Merging #927 (0ef98cc) into master (4155ebe) will increase coverage by 0.07%.
The diff coverage is 95.45%.

❗ Current head 0ef98cc differs from pull request most recent head f6a900a. Consider uploading reports for the commit f6a900a to get more accurate results
Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
crates/lang/ir/src/ir/selector.rs 85.00% <87.50%> (+1.66%) ⬆️
crates/lang/codegen/src/generator/metadata.rs 97.56% <100.00%> (-0.04%) ⬇️
crates/lang/ir/src/literal.rs 100.00% <100.00%> (ø)
crates/allocator/src/bump.rs 100.00% <0.00%> (+20.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4155ebe...f6a900a. Read the comment docs.

Copy link
Contributor

@HCastano HCastano left a 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

Comment on lines +15 to +18
mod private {
/// Used to prevent external direct usage of `HexLiteral::hex_impl_`.
pub struct Sealed;
}
Copy link
Contributor

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?

Copy link
Collaborator Author

@Robbepop Robbepop Sep 20, 2021

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.

@Robbepop Robbepop merged commit 725c2f7 into master Sep 20, 2021
@Robbepop Robbepop deleted the robin-expand-hex-literals branch September 20, 2021 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants