BurntSushi / BurntSushi/byteorder
Add methods that take/return arrays
- Dominant language
- Rust
- Stars
- 1.1k
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
The recently-added standard library endian conversion functions like [`from_be_bytes`](https://doc.rust-lang.org/std/primitive.u16.html#method.from_be_bytes) and [`to_be_bytes`](https://doc.rust-lang.org/std/primitive.u16.html#method.to_be_bytes) operate on arrays by value rather than slices by reference, which can provide better type safety in some cases.
It would be great if the `ByteOrder` trait were to add similar methods so that code which still needs to be generic over byte order can benefit from the array approach. Concretely, I would make use of those methods in the [`zerocopy::byteorder`](https://docs.rs/crate/zerocopy/0.3.0/source/src/byteorder.rs) module if they were available.
cc @tamird
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the ByteOrder trait and its existing endian conversion methods, then compare their APIs with Rust's from_be_bytes and to_be_bytes functions. Review the zerocopy::byteorder module to understand the intended generic use case. Done means the trait offers equivalent array-by-value methods for generic byte-order code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100