cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Lint for redundant feature names

Open epage opened this issue 7 months ago • 0 comments

What it does

Checks for feature names with prefix use-, with- or suffix -support

See also https://rust-lang.github.io/rust-clippy/master/index.html?groups=cargo#/redundant_feature_names?groups=cargo

Advantage

These prefixes and suffixes have no significant meaning.

Drawbacks

No response

Example

[features]
default = ["use-abc", "with-def", "ghi-support"]
use-abc = []  // redundant
with-def = []   // redundant
ghi-support = []   // redundant

Could be written as:

[features]
default = ["abc", "def", "ghi"]
abc = []
def = []
ghi = []

epage avatar May 22 '25 16:05 epage