
Makefile for formatting and linting Workspace for subcrates. Moved crates to subdir and moved subcrate configs to workspace.*
21 lines
517 B
Rust
21 lines
517 B
Rust
use proc_macro::TokenStream;
|
|
|
|
use quote::quote;
|
|
use syn::DeriveInput;
|
|
|
|
pub fn into_response_derive_impl(input: DeriveInput) -> TokenStream {
|
|
let name = &input.ident;
|
|
|
|
let expanded = quote! {
|
|
impl IntoResponse for #name {
|
|
fn into_response(self) -> Response {
|
|
let version = env!("CARGO_PKG_VERSION");
|
|
lib::serde::response::BaseResponse::new(version, self)
|
|
.into_response()
|
|
}
|
|
}
|
|
};
|
|
|
|
TokenStream::from(expanded)
|
|
}
|