Closed cole-h closed 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)"...
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.
Will give it a try in some minutes.
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
cargo build
cargo fmt
cargo clippy
cargo test