Skip to content

Feature names cannot always be free of placeholder words #164

@rushmorem

Description

@rushmorem

The recommendation for C-FEATURE says:-

Do not call the feature use-std or with-std or any creative name that is not std.

I like this naming convention. Unfortunately, it's not always possible to follow. For example, say I want to add optional support for serde, the obvious name for such a feature would be serde. However, if some of my types can be derived automatically, I would also want to optionally depend on serde_derive. Part of my manifest will then end up as follows:

[features]
serde = ["serde", "serde_derive"]

[dependencies]
serde = { version = "1", optional = true }
serde_derive = { version = "1", optional = true }

However, this is not possible since feature names must not conflict with other package names in the manifest. In such a case, I will either have to use a name like with-serde or come up with a creative name for my feature.

Edit: Had forgotten to insert a hyperlink

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions