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 working knownSize implementation to ChunkBuilder instances (Scala 2.13+) #8892

Merged
merged 6 commits into from
May 24, 2024

Conversation

seakayone
Copy link
Contributor

@seakayone seakayone commented May 23, 2024

While implementing zio/zio-http#2862 we needed to get the size of a ChunkBuilder.Byte and saw this was not yet implemented and returned always the default -1 from the underlying Growable trait implementation.

This add the implementation for all current ChunkBuilders Scala 2.13+.

Scala 2.12 is not supported because the underlying scala.collection.mutalbe.ArrayBuilder does not have a suitable knownSize implementation: https://www.scala-lang.org/api/2.12.9/scala/collection/mutable/ArrayBuilder.html

@seakayone seakayone marked this pull request as ready for review May 23, 2024 09:02
@seakayone seakayone changed the title Add knownSize to ChunkBuilder instances Add working knownSize implementation to ChunkBuilder instances (Scala 2.13+) May 23, 2024
Copy link
Member

@guizmaii guizmaii left a comment

Choose a reason for hiding this comment

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

LGTM

@ghostdogpr ghostdogpr merged commit 98b791b into zio:series/2.x May 24, 2024
21 checks passed
@seakayone seakayone deleted the add-known-size-to-ChunkBuilder branch May 24, 2024 07:51
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.

None yet

3 participants