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 =
|
||||
syn::Ident::new(&format!("__make_route_{}", name), name.span());
|
||||
let factory_name = syn::Ident::new(&format!("__make_route_{}", name), name.span());
|
||||
|
||||
// Cleaned method (without route attribute)
|
||||
let non_route_attrs: Vec<_> = method
|
||||
.attrs
|
||||
.iter()
|
||||
.filter(|a| !is_route_attr(a))
|
||||
.collect();
|
||||
let non_route_attrs: Vec<_> =
|
||||
method.attrs.iter().filter(|a| !is_route_attr(a)).collect();
|
||||
let vis = &method.vis;
|
||||
let sig = &method.sig;
|
||||
let block = &method.block;
|
||||
|
||||
@@ -113,10 +113,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[post("/items")]
|
||||
async fn add_item(
|
||||
&self,
|
||||
axum::extract::Json(body): axum::extract::Json<String>,
|
||||
) -> String {
|
||||
async fn add_item(&self, axum::extract::Json(body): axum::extract::Json<String>) -> String {
|
||||
format!("added: {}", body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user