Skip to content

Conversation

evshary
Copy link
Contributor

@evshary evshary commented Jun 9, 2025

Now we need to use publisher.put(sample.payload().clone()).wait().unwrap() because ZBytes can't be transformed into &ZBytes.
Initially, we considered implementing the Copy trait, but Copy can't be implemented in Vec, which is used in SingleOrVec.
If we implement From<&ZBytes> for ZBytes, then sample.payload() (&ZBytes) can be transformed into ZBytes implicitly, and it simplifies the usage.
The downside might be that users aren't aware of the implicit clone, but it should be okay when the clone here is cheap.

Copy link

github-actions bot commented Jun 9, 2025

PR missing one of the required labels: {'new feature', 'breaking-change', 'dependencies', 'internal', 'enhancement', 'bug', 'documentation'}

@evshary evshary requested a review from yellowhatter June 9, 2025 05:56
@evshary evshary added the enhancement Existing things could work better label Jun 9, 2025
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.89%. Comparing base (b33ddc3) to head (d2ae4cc).

Files with missing lines Patch % Lines
zenoh/src/api/bytes.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1981      +/-   ##
==========================================
- Coverage   71.03%   70.89%   -0.15%     
==========================================
  Files         364      364              
  Lines       61519    61522       +3     
==========================================
- Hits        43697    43613      -84     
- Misses      17822    17909      +87     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Existing things could work better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant