-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
313: Improve serializing r=Ogeon a=Ogeon This fixes a long-standing bug in how `Alpha` and `PreAlpha` are serialized. They used to be flattened to a map, which is fine in JSON but not in more expressive formats, such as RON. The replacement implementation will only handle a subset of possible values (structs, tuples and sequences), but they should be the most common ones. It should also be possible to extend it later. I have also taken the opportunity to add some helpful utility functions for serializing and de-serializing. ## Closed Issues * Fixes #130, using a custom implementation. ## Breaking Change Technically breaking, since it changes the serialization format a bit, but the old behavior was buggy and not always usable. The serialized type and name for `Alpha` and `PreAlpha` is now inherited from the color's type. So, for example, `Srgba` will be serialized and de-serialized as an `Rgb` struct with an additional `alpha` field. Unit types get extended to newtypes, and newtypes get extended to tuples. Co-authored-by: Erik Hedvall <erikwhedvall@gmail.com>
- Loading branch information
Showing
7 changed files
with
1,752 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.