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

Stop impl Display for Element from panicking on typed nulls #451

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

popematt
Copy link
Contributor

@popematt popematt commented Dec 7, 2022

Issue #, if available:

Fixes #450

Description of changes:

  • Added a test based on the "good" test vectors in ion-tests to ensure that Display is consistent with the default TextWriter.
  • Fixes the implementation of Display for Element so that it doesn't try to unwrap None.
  • Updates format_struct(), format_list(), and format_sexp() to be consistent with the output of a TextWriter (I removed some extra whitespace inside the containers), and updates the unit tests accordingly.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #451 (2833230) into main (aa33f0f) will increase coverage by 0.37%.
The diff coverage is 95.23%.

@@            Coverage Diff             @@
##             main     #451      +/-   ##
==========================================
+ Coverage   83.57%   83.94%   +0.37%     
==========================================
  Files          87       87              
  Lines       16479    16479              
==========================================
+ Hits        13772    13833      +61     
+ Misses       2707     2646      -61     
Impacted Files Coverage Δ
src/value/owned.rs 76.58% <93.33%> (+1.53%) ⬆️
src/text/text_formatter.rs 50.20% <100.00%> (+9.87%) ⬆️
src/reader.rs 66.41% <0.00%> (-0.26%) ⬇️
src/raw_symbol_token_ref.rs 60.60% <0.00%> (+12.12%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@desaikd desaikd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🚀

@popematt popematt merged commit acac4ae into amazon-ion:main Dec 7, 2022
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.

impl Display for Element panics for typed nulls
4 participants