Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

pub incorrectly consuming a field type#78

Merged
VictorKoenders merged 3 commits intotrunkfrom
fix-77
Jan 16, 2024
Merged

pub incorrectly consuming a field type#78
VictorKoenders merged 3 commits intotrunkfrom
fix-77

Conversation

@VictorKoenders
Copy link
Contributor

Fixes #77

Visibility::try_take has a case where given pub(self) it ignores the (self). It incorrectly assumed pub [u8; 2] was similar. This PR fixes it so it only ignores (...) and not [...]

@codecov
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (591ef63) 48.42% compared to head (d61fb94) 49.16%.
Report is 1 commits behind head on trunk.

❗ Current head d61fb94 differs from pull request most recent head 8a0a3e9. Consider uploading reports for the commit 8a0a3e9 to get more accurate results

Files Patch % Lines
src/parse/body.rs 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk      #78      +/-   ##
==========================================
+ Coverage   48.42%   49.16%   +0.73%     
==========================================
  Files          20       20              
  Lines        2030     2087      +57     
==========================================
+ Hits          983     1026      +43     
- Misses       1047     1061      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VictorKoenders
Copy link
Contributor Author

VictorKoenders commented Nov 28, 2023

Wife pointed out that this will not work for pub struct Foo(pub (u8, )); so it will need more work. This should be updated to only consume pub (...) if the group contains exactly one of:

  • pub ( crate )
  • pub ( self )
  • pub ( super )
  • pub ( in ... )

@VictorKoenders VictorKoenders merged commit 7c390ea into trunk Jan 16, 2024
@VictorKoenders VictorKoenders deleted the fix-77 branch January 16, 2024 09:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty r#type for struct Test(pub [u8; 32])

1 participant