Skip to content

feat(api): add #[non_exhaustive] to public enums and fix doc comments for 0.2.0#1

Merged
bakgio merged 2 commits intomainfrom
chore/add-non-exhaustive-to-public-enums
Mar 30, 2026
Merged

feat(api): add #[non_exhaustive] to public enums and fix doc comments for 0.2.0#1
bakgio merged 2 commits intomainfrom
chore/add-non-exhaustive-to-public-enums

Conversation

@bakgio
Copy link
Copy Markdown
Owner

@bakgio bakgio commented Mar 30, 2026

Why

Public enums shipped in 0.1.0 without #[non_exhaustive], meaning any new variant added in a future release would be a semver-breaking change for downstream crates using exhaustive match. Additionally, doc comments across the codebase contained inaccurate spec values, broken code examples, and misleading method descriptions that could confuse consumers of the library.

What

[api] — Non-exhaustive enums

  • Add #[non_exhaustive] to AudexError, FrameData, KeyType, FLACErrorKind, StandardField, SkipReason, and TrueAudioTags
  • Enables adding enum variants in future minor releases without breaking downstream match arms

[docs] — Doc comment fixes (~50 files)

  • Correct spec inaccuracies: ID3v1 genre counts, AAC sample rate ranges (7350–96000), AAC channel limits (8 not 48), TrueAudio bit depths (8–32), TAK bit depths (8–39), FLAC bits-per-sample range (1–32), VBRI header offset (36 not 32), MPEG sync byte identification (0xFA = MPEG-1 not MPEG-2.5), ENCR/GRID method symbols (>= 0x80 not > 0x80)
  • Fix broken/misleading code examples in id3::mod, replaygain, flac, easymp4, musepack, tak, mp3::file
  • Clarify ID3::size() (excludes 10-byte header), ID3::version() tuple semantics, DiffOptions::normalize_custom_keys scope, TagMap::is_empty() (includes pictures), APEv2 key case-insensitivity, padding behavior, add_tags() trait vs inherent method differences
  • Fix id3::version doc comments (major_version not minor_version)

[ci] — Semver checking

  • Add cargo-semver-checks job to CI workflow to catch future semver violations

[release] — Version bump

  • Bump audex and audex-wasm from 0.1.0 to 0.2.0
  • Update README dependency examples
  • Add CHANGELOG entry for 0.2.0

bakgio added 2 commits March 30, 2026 19:04
…0.2.0

Why

Prepare the 0.2.0 release with semver-safe public enums and accurate
documentation. Non-exhaustive enums allow adding variants in future
minor releases without breaking downstream match arms.

What

- Add #[non_exhaustive] to AudexError, FrameData, KeyType, FLACErrorKind,
  StandardField, SkipReason, and TrueAudioTags
- Fix doc comments across ~50 files: correct spec values (genre counts,
  sample rates, bit depths, channel counts, byte offsets), fix broken
  code examples, and clarify method behavior
- Bump version to 0.2.0 in Cargo.toml, wasm/Cargo.toml, and README.md
- Add cargo-semver-checks CI job
- Add CHANGELOG entry for 0.2.0
Why
- Redundant fully-qualified paths (crate::diff::, crate::AudexError::)
  clutter doc comments when Rust resolves them implicitly
- MAX_IN_MEMORY_WRITER_FILE needed an explicit path for correct
  resolution from the module-level doc block

What
- diff.rs: drop crate::diff:: prefixes on same-module links
- id3/mod.rs: drop crate:: prefix on AudexError link
- limits.rs: add explicit crate::limits:: path for cross-scope link
@bakgio bakgio merged commit 0aaad9e into main Mar 30, 2026
18 checks passed
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.

1 participant