Crates.io | cargo-feature |
lib.rs | cargo-feature |
version | 0.7.0 |
source | src |
created_at | 2020-03-23 12:23:19.150977 |
updated_at | 2022-05-09 13:33:35.097514 |
description | Cargo plugin to manage dependency features |
homepage | https://github.com/Riey/cargo-feature |
repository | https://github.com/Riey/cargo-feature |
max_upload_size | |
id | 221729 |
size | 123,418 |
cargo install cargo-feature
pacman -Syu cargo-feature
nix-env -iA nixos.cargo-feature
# 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