DeterminateSystems / bootspec

Implementation of RFC-0125's datatype and synthesis tooling.
MIT License
24 stars 5 forks source link

bootspec: offer TryInto conversion from Generation to any schema version #120

Closed cole-h closed 1 year ago

cole-h commented 1 year ago

This utilizes the derive_more crate so that we don't have to manually add new implementations for each version.

Description

Closes https://github.com/DeterminateSystems/bootspec/pull/109.

Checklist
cole-h commented 1 year ago

I just realized that "any" here is kinda incorrect... Since deserializing the BootSpec will only return the latest generation version. So, once we have one more version, it will only ever deserialize the latest version (the first one in the enum) (if it exists)...

Maybe for v2 we should change BootSpec's generation field to be a Vec<Generation>... I think that might require a custom deserializer, but it also might not. Then we could maybe provide a helper function for "give me version X if it exists (and error otherwise)"...

cole-h commented 1 year ago

I think this is "not bad" for the moment, though. Assuming @RaitoBezarius doesn't report anything wrong with it, I'll probably cut a 1.0.0 tomorrow.

RaitoBezarius commented 1 year ago

Will give it a try in some minutes.