Martin Berg Alstad 5cd1c075a5 Read files macro for loading reading files to string at compile-time
Makefile for formatting and linting

Workspace for subcrates.

Moved crates to subdir and moved subcrate configs to workspace.*
2024-07-16 18:29:32 +02:00

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)
}