docs: document legacy-msrv feature in README and crate docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2 files changed
+24
No files matched your search
@@ -249,6 +249,24 @@ assert_eq!(ucobs::decode(&[], &mut buf), Some(0)); // decodes to []
|
|||||||
**Note:** The encoder does *not* append a trailing `0x00` sentinel. Append it
|
**Note:** The encoder does *not* append a trailing `0x00` sentinel. Append it
|
||||||
yourself when framing for transport.
|
yourself when framing for transport.
|
||||||
|
|
||||||
|
## Minimum Supported Rust Version
|
||||||
|
|
||||||
|
The default build requires **Rust 1.93+** (for const `copy_from_slice`).
|
||||||
|
|
||||||
|
### `legacy-msrv` feature
|
||||||
|
|
||||||
|
If you're targeting a toolchain older than 1.93 (e.g. Xtensa), enable the
|
||||||
|
`legacy-msrv` feature to fall back to a manual byte copy in the encoder:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[dependencies]
|
||||||
|
ucobs = { version = "0.3", features = ["legacy-msrv"] }
|
||||||
|
```
|
||||||
|
|
||||||
|
All other optimizations (sub-slice scan, zero fast path, decode batch fill)
|
||||||
|
are available regardless of this feature. Only the encode copy phase is
|
||||||
|
affected — it uses a byte loop instead of `copy_from_slice`/memcpy.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
μCOBS has one of the most thorough test suites of any COBS implementation —
|
μCOBS has one of the most thorough test suites of any COBS implementation —
|
||||||
|
|||||||
@@ -12,6 +12,12 @@
|
|||||||
//! This crate is `no_std`, zero-alloc, and `unsafe`-free — it runs
|
//! This crate is `no_std`, zero-alloc, and `unsafe`-free — it runs
|
||||||
//! everywhere from 8-bit MCUs to servers.
|
//! everywhere from 8-bit MCUs to servers.
|
||||||
//!
|
//!
|
||||||
|
//! # Feature flags
|
||||||
|
//!
|
||||||
|
//! - **`legacy-msrv`** — Enables compilation on Rust 1.83+ by replacing
|
||||||
|
//! the const `copy_from_slice` (requires Rust 1.93) with a manual byte
|
||||||
|
//! loop in the encoder. All other optimizations are unaffected.
|
||||||
|
//!
|
||||||
//! # Quick start
|
//! # Quick start
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
|
|||||||
Reference in new issue
Block a user