Skip to content

Optional preserve_order feature to preserve order of vorbis comments (tags)#29

Open
asnare wants to merge 7 commits intojameshurst:mainfrom
asnare:preserve_order
Open

Optional preserve_order feature to preserve order of vorbis comments (tags)#29
asnare wants to merge 7 commits intojameshurst:mainfrom
asnare:preserve_order

Conversation

@asnare
Copy link

@asnare asnare commented Jan 12, 2026

This PR adds support for a preserve_order feature: when enabled the order of tags is preserved within the VorbisComments block. Semantics are:

  • When loading, the order is preserved1.
  • When setting tags, the order will be the order in they were set1.
  • Removal leaves remaining tags in their existing order.
  • Replacing a tag leaves it in its existing position.

These semantics are intended to match those of the preserve_order feature available on serde_json.

To preserve compatibility this feature is not part of the default features: the public interface changes when it is enabled.

Footnotes

  1. Due to the internal implementation, tags are grouped by key: their position will be the location of the first key, and the values will retain their original order. 2

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