-
Add an attribute
#[serde(crate = "path::to::serde")]which replaces the use ofextern crate serdein the generated code; this is intended for crates that invoke Serde derives from a macro and need to refer toserdethrough their own re-export rather than requiring callers to list Serde in Cargo.toml (#1499, thanks @sgrif)#[derive(Deserialize)] #[serde(crate = "__tw::codegen::serde")] struct S { ... }
// expands to: impl<'de> __tw::codegen::serde::Deserialize<'de> for S { ... }