You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we add and remove enum variants of non-consensus enums over time it will often be easier to accept "holes" in the numbering scheme than writing DB migrations that increment/decrement every variant index by one.
now we'd have to write a DB migration that decodes the old Baz values with variant index 2 and re-encodes them with index 1. Instead we could allow the following annotation:
#[derive(Encodable)]enumMyEnum{#[encodable_index = 0]Foo,// idx=0// note how idx=1 is missing#[encodable_index = 2]Baz,// idx=2}
The text was updated successfully, but these errors were encountered:
As we add and remove enum variants of non-consensus enums over time it will often be easier to accept "holes" in the numbering scheme than writing DB migrations that increment/decrement every variant index by one.
For example:
is changed to
now we'd have to write a DB migration that decodes the old
Baz
values with variant index 2 and re-encodes them with index 1. Instead we could allow the following annotation:The text was updated successfully, but these errors were encountered: