Thanks for your interest in contributing! oxicode is a binary serialization library with a strict "no warnings" policy and a large compatibility/fuzz test surface, so please read this before opening a pull request.
- Rust 1.81.0 or newer (this is the MSRV —
rust-versioninCargo.toml). Userustup showto confirm your toolchain, orrustup install 1.81.0to add it alongsidestable. cargo-nextestfor running the test suite:cargo install cargo-nextest --locked.rustfmtandclippycomponents (rustup component add rustfmt clippy).
cargo build --workspace --all-featuresThe workspace has three members: the oxicode crate itself, the
derive proc-macro crate (oxicode_derive), and the internal
compatibility crate (test-only, publish = false, never depend on it
from application code).
Run the full test suite with all features enabled before submitting a change:
cargo nextest run --workspace --all-featuresUseful narrower invocations while iterating:
# Just the oxicode crate
cargo nextest run -p oxicode --all-features
# A subset by name filter
cargo nextest run -p oxicode --all-features -E 'test(compat)'
# Doc tests (nextest does not run these)
cargo test --doc --all-featuresAlso exercise the feature matrix that CI checks, at least for the
feature(s) your change touches: --no-default-features,
--no-default-features --features alloc, and each of simd,
compression-lz4, compression-zstd, serde, async-tokio,
checksum individually.
If you touch any unsafe code (currently confined to
src/de/impls.rs, src/de/borrow_slice.rs,
src/features/impl_alloc.rs, src/simd/aligned.rs), also run it under
Miri:
cargo +nightly miri test -p oxicode --libThis project enforces a zero-warnings policy. Both of the following must be clean before a PR is merged:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warningsPlease run cargo fmt --all (without --check) to auto-format your
changes rather than hand-formatting.
-
snake_casefor variables/functions,UpperCamelCasefor types/traits, matching standard Rust naming conventions (clippy's naming lints are part of the-D warningsgate above). -
No new
unwrap()/expect()/panic!()/unreachable!()in production (src/) code paths — use the existingErrorvariants (src/error.rs) and propagateResultinstead. Test and example code may use them where a failure should abort the test/example. -
Keep individual source files under ~2000 lines; split large modules rather than letting one file grow unbounded.
-
Any test that writes to disk must use
std::env::temp_dir()(ortempfile, already a dev-dependency) rather than hard-coded paths. -
Wire-format stability: oxicode's
standard()/legacy()configs are byte-for-byte compatible with bincode 2.0.1 / bincode 1.x respectively for currently-valid inputs (see thecompatibility/crate andtests/bincode_compat_test.rs). Do not change the serialized byte layout for any input that is valid today; rejecting previously-unvalidated/malicious input, fixing panics, and adding new APIs are all fine. If you are unsure whether a change affects the wire format, run the compatibility suite:cargo test -p oxicode_compatibility cargo nextest run -p oxicode -E 'test(compat)'
Follow the workspace-dependency policy: shared dependencies belong in
[workspace.dependencies] at the repository root and are inherited via
dep = { workspace = true } in each crate's Cargo.toml — avoid
re-pinning a literal version in an individual crate manifest. Prefer the
latest version available on crates.io when adding or bumping a
dependency, with the sole intentional exception of the bincode
dev-dependency, which is pinned to =2.0.1 because it is the
compatibility oracle used by the compat test suite (bincode 3.x has an
incompatible API and must never be introduced — this is also enforced
by deny.toml).
- Fork the repository and create a feature branch.
- Make your change, following the conventions above.
- Add or update tests covering the change.
- Run the build/test/lint commands in this document.
- Update
CHANGELOG.mdunder an "Unreleased" heading if the change is user-visible. - Open a pull request describing the change and its motivation.
Regular bugs: please open a GitHub issue with a minimal reproduction (ideally a byte sequence plus the type/config used to decode it).
Security vulnerabilities (panics, memory-safety issues, or resource-exhaustion bugs triggerable by decoding untrusted input) should not be filed as public issues — see SECURITY.md for the private reporting process.