to-syn-value_derive-0.1.1/.cargo_vcs_info.json0000644000000001360000000000100147340ustar { "git": { "sha1": "4a7bf3397dba1f016c3fbfd57166fa86520028c0" }, "path_in_vcs": "" }to-syn-value_derive-0.1.1/Cargo.toml0000644000000017650000000000100127430ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "to-syn-value_derive" version = "0.1.1" authors = ["Mark Thom "] publish = true description = "Defines the trait targeted by the derive macro defined in to-syn-value." readme = "README.md" license = "BSD-3-Clause" repository = "https://github.com/mthom/to-syn-value_derive" [lib] proc-macro = true [dependencies.proc-macro2] version = "1.0.36" [dependencies.quote] version = "1.0.15" [dependencies.syn] version = "2.0.32" features = [ "full", "visit", "extra-traits", ] to-syn-value_derive-0.1.1/Cargo.toml.orig000064400000000000000000000007511046102023000164160ustar 00000000000000[package] name = "to-syn-value_derive" version = "0.1.1" authors = ["Mark Thom "] description = "Defines the trait targeted by the derive macro defined in to-syn-value." readme = "README.md" repository = "https://github.com/mthom/to-syn-value_derive" license = "BSD-3-Clause" edition = "2021" publish = true [lib] proc-macro = true [dependencies] proc-macro2 = "1.0.36" syn = { version = "2.0.32", features = ['full', 'visit', 'extra-traits'] } quote = "1.0.15"to-syn-value_derive-0.1.1/README.md000064400000000000000000000003351046102023000150040ustar 00000000000000This crate defines a derive macro to introduce a trait implementation converting values of the attributed type to syn::DeriveInput. Meant for use with [to-syn-value](https://github.com/mthom/to-syn-value "to-syn-value"). to-syn-value_derive-0.1.1/src/lib.rs000064400000000000000000000010251046102023000154250ustar 00000000000000use syn::*; use quote::*; #[proc_macro_derive(ToDeriveInput)] pub fn derive_to_derive_input(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let derive_input = parse_macro_input!(input as DeriveInput); let ty_name = derive_input.ident.clone(); quote! { use to_syn_value::*; impl ToDeriveInput for #ty_name { fn to_derive_input() -> syn::DeriveInput { syn::parse_quote! { #derive_input } } } }.into() }