async-graphql/async-graphql-derive/src/utils.rs

14 lines
316 B
Rust
Raw Normal View History

2020-03-02 00:24:49 +00:00
use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::Ident;
pub fn get_crate_name(internal: bool) -> TokenStream {
match internal {
true => quote! { crate },
false => {
let id = Ident::new("async_graphql", Span::call_site());
quote! { #id }
}
}
}