pub fn create_hashable_ordering(tokens: TokenStream) -> TokenStream {
    // Parse TokenStream into AST
    let ast: syn::DeriveInput = syn::parse(tokens).unwrap();
    let name = &ast.ident;
    let gen = quote! {
         impl Ord for #name {
            fn cmp(&self, other: &#name) -> Ordering {
                self.hash().cmp(&other.hash())
            }
        }
        impl PartialOrd for #name {
            fn partial_cmp(&self, other: &#name) -> Option<Ordering> {
                Some(self.cmp(other))
            }
        }
        impl PartialEq for #name {
            fn eq(&self, other: &#name) -> bool {
                self.hash() == other.hash()
            }
        }
        impl Eq for #name {}
    };
    gen.into()
}
// this is the actual code for the hashable ordering macro, function in lib points to this one
this is the actual code for the hashable ordering macro, function in lib points to this one
this is the actual code for the hashable ordering macro function in lib points to this one
pub fn create_hashable_ordering(tokens: TokenStream) -> TokenStream {
    // Parse TokenStream into AST
    let ast: syn::DeriveInput = syn::parse(tokens).unwrap();
    let name = &ast.ident;
    let gen = quote! {
         impl Ord for #name {
            fn cmp(&self, other: &#name) -> Ordering {
                self.hash().cmp(&other.hash())
            }
        }
        impl PartialOrd for #name {
            fn partial_cmp(&self, other: &#name) -> Option<Ordering> {
                Some(self.cmp(other))
            }
        }
        impl PartialEq for #name {
            fn eq(&self, other: &#name) -> bool {
                self.hash() == other.hash()
            }
        }
        impl Eq for #name {}
    };
    gen.into()
}
pub fn create_hashable_ordering ( tokens : TokenStream ) -> TokenStream { // Parse TokenStream into AST let ast : syn :: DeriveInput = syn :: parse ( tokens ) . unwrap ( ) ; let name = & ast . ident ; let gen = quote ! { impl Ord for name { fn cmp ( self other name ) Ordering { self hash ( ) cmp ( other hash ( ) ) } } impl PartialOrd for name { fn partial_cmp ( self other name ) Option Ordering { Some ( self cmp ( other ) ) } } impl PartialEq for name { fn eq ( self other name ) bool { self hash ( ) other hash ( ) } } impl Eq for name { } } ; gen . into ( ) }
this is the actual code for the hashable ordering macro, function in lib points to this one
this is the actual code for the hashable ordering macro function in lib points to this one
tokens
TokenStream
tokens
TokenStream