Skip to content

Make #[non_exhaustive] in the api crate optional #25

@xFrednet

Description

@xFrednet

Almost every enum and struct in the API has the #[non_exhaustive] marker to ensure that it can easily be expanded. This is nice for stability, but not ideal for driver implementations. There could also be users who would prefer a failing compilation, rather than adding wildcards to every match statement.

For this reason, I would like to have a feature (which is enabled by default) that can enable the #[non_exhaustive] marker.

The implementation will probably be as simple as using:

#[cfg_attr(feature = "add-non-exhaustive", non_exhaustive)]

The feature name is just an example, another name might be better

The feature should also include some documentation, that disabling it (not using default features) might cause compilation failures when the API is updated.

Metadata

Metadata

Assignees

Labels

A-apiArea: Stable APIC-enhancementCategory: New feature or requestE-good-first-issueParticipation: Good for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions