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; }
|
quote! { #vis struct #name; }
|
||||||
} else {
|
} else {
|
||||||
quote! {
|
quote! {
|
||||||
#vis struct #name #struct_generics (core::marker::PhantomData<#phantom_tuple>)
|
#vis struct #name #struct_generics (core::marker::PhantomData<#phantom_tuple>);
|
||||||
#where_clause;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let default_expr = if generics.params.is_empty() {
|
||||||
|
quote! { Self }
|
||||||
|
} else {
|
||||||
|
quote! { Self(core::marker::PhantomData) }
|
||||||
|
};
|
||||||
|
|
||||||
let stream = quote! {
|
let stream = quote! {
|
||||||
#(#doc_attributes)*
|
#(#doc_attributes)*
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[derive(Default)]
|
|
||||||
#struct_def
|
#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
|
impl #impl_generics ::actix_web::dev::HttpServiceFactory for #name #ty_generics
|
||||||
#where_clause
|
#where_clause
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue