Confusing documentation around `Arc<[u8]>` compatibility
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- documentation
Research direction
Start with the Bytes documentation's sharing section at the linked docs.rs page and compare its Arc<[u8]> statement with the conversions the crate actually provides. Update the wording so it describes supported behavior without implying a nonexistent conversion, then verify the rendered documentation is accurate.
Written by the indexing model from the issue text.
Description
The latest documentation of the crate reads:
For Bytes implementations which point to a reference counted shared storage (e.g. an Arc<[u8]>),
sharing will be implemented by increasing the reference count.
Reference: https://docs.rs/bytes/latest/bytes/struct.Bytes.html#sharing
This lead me to assume that Bytes should provide a from conversion function from an Arc<[u8]> to a Bytes instance where the backing storage is an Arc. However, it doesn't appear that this from function exists.
I don't think it's a good idea for documentation to reference imaginary scenarios that aren't implemented by the library as it sets up false expectations with regard to how the library works and what features it provides.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tokio-rs/bytes
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Optimize Extend trait to have BytesMut::extend(&mut self, &[u8) compile to a `memcpy` when possible Open
Difficulty 3/5 1-2 days Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 47/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100