Implement `From<&ZBytes> for ZBytes` to simplify usage
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.
PR missing one of the required labels: {'new feature', 'breaking-change', 'dependencies', 'internal', 'enhancement', 'bug', 'documentation'}
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 :warning: |
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.