feat: Add visibilty to codegen of route struct

This commit is contained in:
Cobalt 2022-03-28 11:20:44 +02:00
parent e942d3e3b1
commit 1613f830e6
No known key found for this signature in database
GPG Key ID: B62E03F0AD0E3B92
1 changed files with 2 additions and 1 deletions

View File

@ -291,6 +291,7 @@ impl ToTokens for Route {
resource_type,
doc_attributes,
} = self;
let visibility = &ast.vis;
let resource_name = resource_name
.as_ref()
.map_or_else(|| name.to_string(), LitStr::value);
@ -316,7 +317,7 @@ impl ToTokens for Route {
let stream = quote! {
#(#doc_attributes)*
#[allow(non_camel_case_types, missing_docs)]
pub struct #name;
#visibility struct #name;
impl ::actix_web::dev::HttpServiceFactory for #name {
fn register(self, __config: &mut actix_web::dev::AppService) {