make it work on msrv

This commit is contained in:
Yuki Okushi 2026-02-05 16:24:52 +09:00
parent bea1e5ca4a
commit 64946ac15c
1 changed files with 13 additions and 3 deletions

View File

@ -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
{