mirror of https://github.com/fafhrd91/actix-web
make it work on msrv
This commit is contained in:
parent
bea1e5ca4a
commit
64946ac15c
|
|
@ -527,17 +527,27 @@ impl ToTokens for Route {
|
|||
quote! { #vis struct #name; }
|
||||
} else {
|
||||
quote! {
|
||||
#vis struct #name #struct_generics (core::marker::PhantomData<#phantom_tuple>)
|
||||
#where_clause;
|
||||
#vis struct #name #struct_generics (core::marker::PhantomData<#phantom_tuple>);
|
||||
}
|
||||
};
|
||||
|
||||
let default_expr = if generics.params.is_empty() {
|
||||
quote! { Self }
|
||||
} else {
|
||||
quote! { Self(core::marker::PhantomData) }
|
||||
};
|
||||
|
||||
let stream = quote! {
|
||||
#(#doc_attributes)*
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Default)]
|
||||
#struct_def
|
||||
|
||||
impl #impl_generics ::core::default::Default for #name #ty_generics {
|
||||
fn default() -> Self {
|
||||
#default_expr
|
||||
}
|
||||
}
|
||||
|
||||
impl #impl_generics ::actix_web::dev::HttpServiceFactory for #name #ty_generics
|
||||
#where_clause
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue