cargo-feature

Crates.iocargo-feature
lib.rscargo-feature
version0.7.0
sourcesrc
created_at2020-03-23 12:23:19.150977
updated_at2022-05-09 13:33:35.097514
descriptionCargo plugin to manage dependency features
homepagehttps://github.com/Riey/cargo-feature
repositoryhttps://github.com/Riey/cargo-feature
max_upload_size
id221729
size123,418
(Riey)

documentation

https://github.com/Riey/cargo-feature#usage

README

cargo-feature

CI Crates.io

Packaging status

preview

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
Commit count: 99

cargo fmt