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

Correct parsing of arrays and byte arrays #47

Merged

Conversation

mat-kie
Copy link
Contributor

@mat-kie mat-kie commented Jan 4, 2025

Related to #46

Behavioral Changes

  • If a single byte inside a Byte array is valid, all bytes are considered valid
  • guard against multiple discriminants in value arrays

Changes:

  • Fix return type for Value::Byte in data_field_value
  • avoid vector re allocations during parsing
  • add checks to ensure a Value::Array is only valid if all entries share the same discriminant (or are set to Invalid)
  • add test cases for Byte array parsing
  • add tests for is_valid check

… of differing discriminants"

This reverts commit 4fb4407.
@mat-kie mat-kie force-pushed the improve-array-handling branch from fa0ba54 to 2ead350 Compare January 6, 2025 07:23
@stadelmanma
Copy link
Owner

Looks great, thank you for this!

@stadelmanma stadelmanma merged commit b4f4eda into stadelmanma:improve-array-handling Jan 7, 2025
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