移除无用注释
This commit is contained in:
parent
dfe586c231
commit
0c629764a8
@ -22,11 +22,7 @@ pub fn gen_responsable(input: DeriveInput) -> TokenStream {
|
||||
impl #impl_generics axum::response::IntoResponse for #name #generics #where_clause {
|
||||
fn into_response(self) -> axum::http::Response<axum::body::Body> {
|
||||
let mut builder = hyper::Response::builder();
|
||||
// .status(#status) // 设置状态码
|
||||
// .headers(#headers); // 设置头部信息
|
||||
|
||||
let body = serde_json::to_string(&self).expect("Failed to serialize response"); // 序列化结构体为JSON字符串
|
||||
|
||||
axum::http::Response::new(axum::body::Body::from(body)) // 构建响应
|
||||
}
|
||||
}
|
||||
@ -39,12 +35,7 @@ pub fn gen_responsable(input: DeriveInput) -> TokenStream {
|
||||
quote! {
|
||||
impl #impl_generics axum::response::IntoResponse for #name #generics #where_clause {
|
||||
fn into_response(self) -> axum::http::Response<axum::body::Body> {
|
||||
// let mut builder = hyper::Response::builder();
|
||||
// .status(#status) // 设置状态码
|
||||
// .headers(#headers); // 设置头部信息
|
||||
|
||||
let body = serde_json::to_string(&self).expect("Failed to serialize response"); // 序列化结构体为JSON字符串
|
||||
|
||||
axum::http::Response::new(axum::body::Body::from(body)) // 构建响应
|
||||
}
|
||||
}
|
||||
@ -57,12 +48,7 @@ pub fn gen_responsable(input: DeriveInput) -> TokenStream {
|
||||
quote! {
|
||||
impl #impl_generics axum::response::IntoResponse for #name #generics #where_clause {
|
||||
fn into_response(self) -> axum::http::Response<axum::body::Body> {
|
||||
// let mut builder = hyper::Response::builder();
|
||||
// .status(#status) // 设置状态码
|
||||
// .headers(#headers); // 设置头部信息
|
||||
|
||||
let body = serde_json::to_string(&self).expect("Failed to serialize response"); // 序列化结构体为JSON字符串
|
||||
|
||||
axum::http::Response::new(hyper::body::Body::from(body)) // 构建响应
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user