33 words
1 minute
`serde_derive` amazingly smart
2024-07-22
No Tags

Within context like this:

#[derive(Serialize, Deserialize)]
#[serde(transparent)]
pub struct Id<T: Register> {
id: &'static str,
_phantom: PhantomData<T>,
}

serde_derive intelligently recognizes that there is no need to serialize _phantom and the #[serde(transparent)] flag simply works.

`serde_derive` amazingly smart
https://misaka10987.github.io/posts/migrate/old/202407/serde-is-good/
Author
misaka10987
Published at
2024-07-22
License
CC BY-NC-SA 4.0