rose-bitset-derive 0.1.0-beta

Procedural macros internal to the 'rose-bitsets' crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use proc_macro2::TokenStream;
use quote::quote;
use syn::Ident;

pub fn generate_code(ident: &Ident) -> TokenStream {
    quote! {
        impl ::core::fmt::Debug for #ident {
            fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
                f.debug_set()
                    .entries(self.iter_indices::<crate::Ascending>())
                    .finish()
            }
        }
    }
}