mirror of https://github.com/fafhrd91/actix-web
Apply suggestions from code review
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
This commit is contained in:
parent
f78b219856
commit
16d21906df
|
@ -229,10 +229,9 @@ impl Route {
|
||||||
//
|
//
|
||||||
// Note that multi line doc comments are converted to multiple doc
|
// Note that multi line doc comments are converted to multiple doc
|
||||||
// attributes.
|
// attributes.
|
||||||
let mut doc_attribute = Vec::new();
|
let mut doc_attributes = Vec::new();
|
||||||
for attr in &ast.attrs {
|
for attr in &ast.attrs {
|
||||||
if let Some(ident) = attr.path.get_ident() {
|
if attr.path.get_ident().is_ident("doc") {
|
||||||
if ident == "doc" {
|
|
||||||
doc_attribute.push(attr.clone());
|
doc_attribute.push(attr.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -283,7 +282,7 @@ impl ToTokens for Route {
|
||||||
methods,
|
methods,
|
||||||
},
|
},
|
||||||
resource_type,
|
resource_type,
|
||||||
doc_attributes: doc_attribute,
|
doc_attributes,
|
||||||
} = self;
|
} = self;
|
||||||
let resource_name = name.to_string();
|
let resource_name = name.to_string();
|
||||||
let method_guards = {
|
let method_guards = {
|
||||||
|
@ -311,7 +310,7 @@ impl ToTokens for Route {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let stream = quote! {
|
let stream = quote! {
|
||||||
#doc_comment_token_stream
|
#(#doc_comments)*
|
||||||
#[allow(non_camel_case_types, missing_docs)]
|
#[allow(non_camel_case_types, missing_docs)]
|
||||||
pub struct #name;
|
pub struct #name;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue