15 unstable releases (6 breaking)
0.7.0 | May 9, 2022 |
---|---|
0.6.0 | Oct 31, 2021 |
0.5.5 | Oct 26, 2021 |
0.5.2 | Apr 8, 2021 |
0.2.0 | Mar 25, 2020 |
#382 in Cargo plugins
408 downloads per month
91KB
376 lines
cargo-feature
Install
Cargo
cargo install cargo-feature
Arch
pacman -Syu cargo-feature
NixOS
nix-env -iA nixos.cargo-feature
Usage
# add serde_derive feature to build-dependency of serde
cargo feature -t build serde +serde_derive
# disable default-features
cargo feature serde ^default
# same as above but more explict
cargo feature serde --disable-default-features
# if you want list all features, just type crate name
cargo feature serde
# enable default-features
cargo feature serde default
# same as above but more explict
cargo feature serde --enable-default-features
# add HtmlDivElement feature to dependency of web_sys
cargo feature web_sys +HtmlDivElement
# you can skip typing +
cargo feature web_sys HtmlDivElement
# same as above but use `target.'cfg(target_arch = "wasm32")'.dependencies`
cargo feature --target="cfg(target_arch = \"wasm32\")" web_sys HtmlDivElement
# use `^` to remove feature
cargo feature web_sys ^HtmlDivElement
Dependencies
~6.5MB
~115K SLoC