-
Notifications
You must be signed in to change notification settings - Fork 33
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
Removes the separate no_text_values
collection in Struct
#430
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Introduces the `SymbolRef` type, a borrowed view of a text value for field lookups. * Introduces the `AsSymbolRef` trait to allow values to be temporarily viewed as a `SymbolRef`. * Modifies the `IonStruct` trait to use `AsSymbolRef` for lookups instead of `AsRef<str>`. This change enables lookups for unknown text. * Modifies the `StructRef` type to use `AsSymbolRef` for its lookup methods. * Modifies the `Struct` type to use `AsSymbolRef` for its lookup methods. * Modifies the `Struct` type to store its values in a `SmallVec`, improving the performance of the common case. The first field value for any given field name will be stored directly in the map. If the field name is repeated, the additional values will be stored elsewhere on the heap. Prior to this change, *all* field values were stored on the heap in a `Vec`. * Adds `len()` and `is_empty()` methods to the `Struct` type. We will likely wish to move these into the `IonStruct` trait in the future. * Tweaks the ion-tests test runner to print the Ion text of the elements that caused test failures instead of using their auto-generated `Debug` format.
Codecov Report
@@ Coverage Diff @@
## main #430 +/- ##
==========================================
- Coverage 83.53% 83.34% -0.19%
==========================================
Files 82 83 +1
Lines 15526 15770 +244
==========================================
+ Hits 12969 13143 +174
- Misses 2557 2627 +70
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
desaikd
reviewed
Sep 27, 2022
zslayton
commented
Sep 27, 2022
desaikd
approved these changes
Sep 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SymbolRef
type, a borrowed view of a text value for field lookups.AsSymbolRef
trait to allow values to be temporarily viewed as aSymbolRef
.IonStruct
trait to useAsSymbolRef
for lookups instead ofAsRef<str>
. This change enables lookups for unknown text.StructRef
type to useAsSymbolRef
for its lookup methods.Struct
type to useAsSymbolRef
for its lookup methods.Struct
type to store its values in aSmallVec
, improving the performance of the common case. The first field value for any given field name will be stored directly in the map. If the field name is repeated, the additional values will be stored elsewhere on the heap. Prior to this change, all field values were stored on the heap in aVec
.len()
andis_empty()
methods to theStruct
type. We will likely wish to move these into theIonStruct
trait in the future.Debug
format.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.