Compare commits
1 Commits
de24db2d2c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5dc358ccb8 |
@@ -156,15 +156,11 @@ fn controller_on_impl(impl_block: ItemImpl) -> TokenStream {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let factory_name =
|
let factory_name = syn::Ident::new(&format!("__make_route_{}", name), name.span());
|
||||||
syn::Ident::new(&format!("__make_route_{}", name), name.span());
|
|
||||||
|
|
||||||
// Cleaned method (without route attribute)
|
// Cleaned method (without route attribute)
|
||||||
let non_route_attrs: Vec<_> = method
|
let non_route_attrs: Vec<_> =
|
||||||
.attrs
|
method.attrs.iter().filter(|a| !is_route_attr(a)).collect();
|
||||||
.iter()
|
|
||||||
.filter(|a| !is_route_attr(a))
|
|
||||||
.collect();
|
|
||||||
let vis = &method.vis;
|
let vis = &method.vis;
|
||||||
let sig = &method.sig;
|
let sig = &method.sig;
|
||||||
let block = &method.block;
|
let block = &method.block;
|
||||||
|
|||||||
@@ -113,10 +113,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[post("/items")]
|
#[post("/items")]
|
||||||
async fn add_item(
|
async fn add_item(&self, axum::extract::Json(body): axum::extract::Json<String>) -> String {
|
||||||
&self,
|
|
||||||
axum::extract::Json(body): axum::extract::Json<String>,
|
|
||||||
) -> String {
|
|
||||||
format!("added: {}", body)
|
format!("added: {}", body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user