Skip to main content

shiv_macro/
lib.rs

1fn shiv_path() -> syn::Path {
2    match proc_macro_crate::crate_name("shiv") {
3        Ok(found) => match found {
4            proc_macro_crate::FoundCrate::Itself => syn::parse_quote!(shiv),
5            proc_macro_crate::FoundCrate::Name(name) => {
6                let ident: syn::Ident = syn::parse_str(&name).unwrap();
7                syn::parse_quote!(::#ident)
8            }
9        },
10        Err(_) => syn::parse_quote!(shiv),
11    }
12}
13
14shiv_macro_impl::implement!(shiv_path());