Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document crate Cargo features #280

Open
edmorley opened this issue Apr 23, 2024 · 1 comment
Open

Document crate Cargo features #280

edmorley opened this issue Apr 23, 2024 · 1 comment

Comments

@edmorley
Copy link

edmorley commented Apr 23, 2024

Hi

The zstd crate currently has the legacy, arrays, zdict_builder features enabled by default:

zstd-rs/Cargo.toml

Lines 31 to 32 in e470f00

[features]
default = ["legacy", "arrays", "zdict_builder"]

I was curious what impact using default-features = false would have, however, could not find any docs on those default features (or most of the optional features) on either of:
https://docs.rs/zstd/latest/zstd/
https://github.com/gyscos/zstd-rs/blob/main/Readme.md

For the features that are passed to zstd-safe, I also tried checking here for feature docs:
https://docs.rs/zstd-safe/latest/zstd_safe/
https://github.com/gyscos/zstd-rs/blob/main/zstd-safe/Readme.md

There are some inline code comments in zstd-sys's Cargo.toml:

debug = [] # Enable zstd debug logs
experimental = [] # Expose experimental ZSTD API
legacy = [] # Enable legacy ZSTD support (for versions < zstd-0.8)
non-cargo = [] # Silence cargo-specific build flags
pkg-config = [] # Use pkg-config to build the zstd C library.
std = [] # Deprecated: we never use types from std.
zstdmt = [] # Enable multi-thread support (with pthread)
thin = [] # Optimize binary by size
no_asm = [] # Disable ASM files (only on amd64 for decompression)
zdict_builder = [] # Enable dictionary building (dictionary _using_ is always supported).
no_wasm_shim = [] # Disable wasm shims (in case your wasm toolchain includes a C stdlib).

...however, these are quite brief, don't cover all of the features present in the top-level zstd crate, and were less obvious to find.

Some docs on the module rustdocs and/or the README would help with discoverability :-)

@poliorcetics
Copy link

I concur, documentation would be nice

It's possible to document the features in the Cargo.toml and then use https://docs.rs/document-features/latest/document_features/ to make that appear in the crate docs, which helps ensure the feature docs are up to date by being just above the relevant feature declaration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants