-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove serde::Serialize
implementations for rkyv-able structs
#7663
Conversation
@@ -346,7 +350,8 @@ impl<'de> serde::de::Deserialize<'de> for ToolUvSources { | |||
} | |||
} | |||
|
|||
#[derive(Serialize, Deserialize, OptionsMetadata, Default, Debug, Clone, PartialEq, Eq)] | |||
#[derive(Deserialize, OptionsMetadata, Default, Debug, Clone, PartialEq, Eq)] | |||
#[cfg_attr(test, derive(Serialize))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigh, these need Serialize
for testing. Wonder if we should just use the debug repr though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug
repr for tests seems fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kind of bad because we have glob patterns and the debug repr is very verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -346,7 +350,8 @@ impl<'de> serde::de::Deserialize<'de> for ToolUvSources { | |||
} | |||
} | |||
|
|||
#[derive(Serialize, Deserialize, OptionsMetadata, Default, Debug, Clone, PartialEq, Eq)] | |||
#[derive(Deserialize, OptionsMetadata, Default, Debug, Clone, PartialEq, Eq)] | |||
#[cfg_attr(test, derive(Serialize))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug
repr for tests seems fine to me.
Summary
Random, but I noticed that we can remove a ton of serialize and deserialize derives by using
rkyv
for the flat-index caches. (We already userkyv
for these same structs in the registry cache.)