Back to all reviewers

Document feature flags

tokio-rs/axum
Based on 3 comments
TOML

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.

Configurations TOML

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.

3
Comments Analyzed
TOML
Primary Language
Configurations
Category

Source Discussions