baek_hyang / Furina & Rafale
33 words
1 minute
`serde_derive` amazingly smart
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/