Document feature flags

When configuring feature flags in Cargo.toml, ensure they are properly structured and documented. Chain feature dependencies correctly, document non-obvious configuration choices with comments, and use appropriate syntax for conditional feature activation.

copy reviewer prompt

Prompt

Reviewer Prompt

When configuring feature flags in Cargo.toml, ensure they are properly structured and documented:

  1. Chain feature dependencies correctly - Features that depend on other features should explicitly list those dependencies: ```toml

    Incorrect:

    cookie-signed = [“cookie-lib/signed”]

Correct:

cookie-signed = [“cookie”, “cookie-lib/signed”]


2. **Document non-obvious configuration choices** with comments to help other developers understand your reasoning:
```toml
# `default-features = false` to not depend on tokio which doesn't support compiling to wasm
axum = { path = "../../axum", default-features = false }
  1. Use appropriate syntax for conditional feature activation, understanding special operators like ? for optional dependencies:
    async-read-body = ["dep:tokio-util", "tokio-util?/io"]
    

These practices ensure that your configuration is both functionally correct and easier for other developers to understand and maintain.

Source discussions