Refer directly to serde_path in Deserialize impl
This makes it not a breaking change if we later want to eliminate the `use #serde_path as _serde;` line.
This commit is contained in:
parent
b4d8a55b2a
commit
2f1945eaf2
@ -27,15 +27,16 @@ pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<TokenStream
|
||||
let (de_impl_generics, _, ty_generics, where_clause) = split_with_de_lifetime(¶ms);
|
||||
let body = Stmts(deserialize_body(&cont, ¶ms));
|
||||
let delife = params.borrowed.de_lifetime();
|
||||
let serde = cont.attrs.serde_path();
|
||||
|
||||
let impl_block = if let Some(remote) = cont.attrs.remote() {
|
||||
let vis = &input.vis;
|
||||
let used = pretend::pretend_used(&cont);
|
||||
quote! {
|
||||
impl #de_impl_generics #ident #ty_generics #where_clause {
|
||||
#vis fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<#remote #ty_generics, __D::Error>
|
||||
#vis fn deserialize<__D>(__deserializer: __D) -> #serde::export::Result<#remote #ty_generics, __D::Error>
|
||||
where
|
||||
__D: _serde::Deserializer<#delife>,
|
||||
__D: #serde::Deserializer<#delife>,
|
||||
{
|
||||
#used
|
||||
#body
|
||||
@ -47,10 +48,10 @@ pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<TokenStream
|
||||
|
||||
quote! {
|
||||
#[automatically_derived]
|
||||
impl #de_impl_generics _serde::Deserialize<#delife> for #ident #ty_generics #where_clause {
|
||||
fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error>
|
||||
impl #de_impl_generics #serde::Deserialize<#delife> for #ident #ty_generics #where_clause {
|
||||
fn deserialize<__D>(__deserializer: __D) -> #serde::export::Result<Self, __D::Error>
|
||||
where
|
||||
__D: _serde::Deserializer<#delife>,
|
||||
__D: #serde::Deserializer<#delife>,
|
||||
{
|
||||
#body
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user