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

Make Structure.fields a dictionary #52

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Conversation

Schamper
Copy link
Member

This PR makes Structure.fields a dictionary, rather than a list. A dictionary mapping of fields is generally more useful to end-users, so this change makes that more easily available.

The list of fields is still available at __fields__ and is still considered the "single source of truth" of the structure contents. Because this change effectively makes fields behave exactly like the old lookup, I've removed __lookup__ and moved that into lookup.

This PR merges into the union editting v4 PR because it relies on some changes in there.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

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

Comparison is base (324a364) 90.87% compared to head (597cffa) 90.90%.

Files Patch % Lines
dissect/cstruct/cstruct.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           v4-union-editing      #52      +/-   ##
====================================================
+ Coverage             90.87%   90.90%   +0.03%     
====================================================
  Files                    19       19              
  Lines                  2027     2034       +7     
====================================================
+ Hits                   1842     1849       +7     
  Misses                  185      185              
Flag Coverage Δ
unittests 90.90% <96.55%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@Schamper Schamper merged commit c96f259 into v4-union-editing Nov 24, 2023
32 checks passed
@Schamper Schamper deleted the v4-fields-dict branch November 24, 2023 09:27
Schamper added a commit that referenced this pull request Nov 26, 2023
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.

2 participants