移除无用注释

This commit is contained in:
李运家 2024-10-12 19:26:31 +08:00
parent dfe586c231
commit 0c629764a8

View File

@ -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)) // 构建响应
}
}