Skip to content

Add #[non_exhaustive] to public API enums likely to grow#69

Merged
algesten merged 1 commit intomainfrom
non-exhaustive-public-enums
Mar 1, 2026
Merged

Add #[non_exhaustive] to public API enums likely to grow#69
algesten merged 1 commit intomainfrom
non-exhaustive-public-enums

Conversation

@algesten
Copy link
Copy Markdown
Owner

@algesten algesten commented Mar 1, 2026

Summary

  • Add #[non_exhaustive] to Output, Error, SrtpProfile, NamedGroup, SignatureScheme, and Dtls13CipherSuite so new variants can be added without a semver-breaking release
  • Leave HashAlgorithm, SignatureAlgorithm, ContentType, ProtocolVersion, and CompressionMethod exhaustive — these are stable protocol-level types unlikely to gain new variants
  • Add wildcard match arms in tests to satisfy the new requirement

Mark Output, Error, SrtpProfile, NamedGroup, SignatureScheme,
Dtls13CipherSuite with #[non_exhaustive] so new variants can be
added without a semver-breaking release.

Enums left exhaustive (HashAlgorithm, SignatureAlgorithm,
ContentType, ProtocolVersion, CompressionMethod) are stable
protocol-level types unlikely to gain new variants.
@algesten algesten merged commit 385e61e into main Mar 1, 2026
45 checks passed
@algesten algesten deleted the non-exhaustive-public-enums branch March 1, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants