Skip to content

Make {Trace|Span}ID conform to Collection #19

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

Closed
wants to merge 4 commits into from

Conversation

t089
Copy link
Contributor

@t089 t089 commented Sep 16, 2024

And remove bytes.

Alternative to #18

Avoids a bunch of code and should yield the same results and be even easier to use. Still need to run the benchmark.

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.54%. Comparing base (aeeea07) to head (92a46a0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   99.50%   99.54%   +0.04%     
==========================================
  Files           6        6              
  Lines         402      442      +40     
==========================================
+ Hits          400      440      +40     
  Misses          2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@slashmo slashmo left a comment

Choose a reason for hiding this comment

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

LGTM 👍 I agree that this feels even better than the previous approach. Could you please run the soundness script on the PR? Then it should work on CI as well.

@t089
Copy link
Contributor Author

t089 commented Sep 17, 2024

I am still not sure if we really want {Trace|Span}ID to be a Collection<UInt8> itself or should the ID value be more opaque. If they would not be a collection themself, it would still be possible to expose a public var bytes: some Collection<UInt8> which exposes the underlying tuple as a Collection<UInt8> struct wrapper. This would then again be more similar to the previous PR #18.

@slashmo
Copy link
Member

slashmo commented Sep 17, 2024

it would still be possible to expose a public var bytes: some Collection which exposes the underlying tuple as a Collection struct wrapper

Wouldn't this cause an allocation when accessing the bytes by creating an instance of the struct wrapper?

@t089
Copy link
Contributor Author

t089 commented Sep 25, 2024

I think I found a way to make #18 nicer

@t089 t089 closed this Sep 25, 2024
@slashmo
Copy link
Member

slashmo commented Sep 25, 2024

Cool! Please ping me on the other PR once there's something new to review 🙏

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.

3 participants