Skip to content

Instantly share code, notes, and snippets.

View rctrj's full-sized avatar
🎮
Probably Playing

Rachit Raj rctrj

🎮
Probably Playing
  • India
View GitHub Profile
@rctrj
rctrj / lib.rs
Created October 23, 2023 04:05
display using debug
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};
#[proc_macro_derive(DisplayUsingDebug)]
pub fn derive_display_using_debug(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let name = ast.ident;
TokenStream::from(quote! {