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

Add a ToIonDataSource implementation for std::io::Cursor and references to byte arrays. #406

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

jnicholls
Copy link
Contributor

@jnicholls jnicholls commented Aug 10, 2022

What's changing?

  • Adding an implementation of ToIonDataSource for std::io::Cursor for completeness.
  • Adding an implementation of ToIonDataSource for &[u8; N] as an additional acceptable type for any method accepting a ToIonDataSource, such as the readers.
  • Update the IonDataSource trait to have default implementations, since it requires BufRead.
  • Update the ToIonDataSource to put a trait bound on the DataSource associated type of IonDataSource instead of BufRead which is more specific and correct.

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

@zslayton
Copy link
Contributor

The change looks good, but the build is currently failing. Could you take a look when you have a chance?

@jnicholls
Copy link
Contributor Author

Yeah, I forgot to add some files and test updates, sorry. I have a few branches going. I'll get back to this in a little bit. Thanks.

@jnicholls
Copy link
Contributor Author

Seems like the builds are stuck pending... 🤷‍♂️

@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #406 (9721de6) into main (cebec11) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #406   +/-   ##
=======================================
  Coverage   88.47%   88.47%           
=======================================
  Files          82       82           
  Lines       14059    14059           
=======================================
+ Hits        12438    12439    +1     
+ Misses       1621     1620    -1     
Impacted Files Coverage Δ
src/data_source.rs 91.91% <100.00%> (ø)
src/text/raw_text_reader.rs 90.58% <0.00%> (+0.16%) ⬆️

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

@zslayton zslayton merged commit 9445115 into amazon-ion:main Aug 12, 2022
@zslayton
Copy link
Contributor

Thanks for the PR!

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