cyclonedx-rust-cargo icon indicating copy to clipboard operation
cyclonedx-rust-cargo copied to clipboard

Drop `#[non_exhaustive]` from `SpecVersion`

Open Shnatsel opened this issue 7 months ago • 0 comments

Adding every new spec version required an API break anyway, so there isn't any benefit to having #[non_exhaustive].

However, this #[non_exhaustive] has caused serious real-world bugs: https://github.com/CycloneDX/cyclonedx-rust-cargo/pull/722 https://github.com/CycloneDX/cyclonedx-rust-cargo/pull/723

So drop it now that we're making a semver-breaking release anyway.

Also drop #[repr(u16)] because it fits into a u8 perfectly fine, and the layout isn't relied on anywhere as far as I can tell. This is semver-breaking too, which is why I'm doing it now.

Shnatsel avatar Jul 17 '24 03:07 Shnatsel