gyscos / zstd-rs

A rust binding for the zstd compression library.
MIT License
504 stars 105 forks source link

Document crate Cargo features #280

Open edmorley opened 5 months ago

edmorley commented 5 months ago

Hi

The zstd crate currently has the legacy, arrays, zdict_builder features enabled by default: https://github.com/gyscos/zstd-rs/blob/e470f0021d25cd5f79431acba0b7456301c00b82/Cargo.toml#L31-L32

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: https://github.com/gyscos/zstd-rs/blob/e470f0021d25cd5f79431acba0b7456301c00b82/zstd-safe/zstd-sys/Cargo.toml#L68-L78

...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 commented 4 months ago

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