Features and Profiles
Conditional compilation.
What Are Features?
Features let you enable or disable optional parts of a crate at compile time. They make crates flexible: callers pay only for what they use.
Declaring Features
Define features in the [features] table. Each feature can turn on other features or optional dependencies.
[features]
default = ["json"]
json = []
fast_math = []All lessons in this course
- Cargo Basics
- Cargo.toml
- Workspaces
- Features and Profiles