Use fully qualified paths in macro expansion #186
This commit is contained in:
parent
efbecbca5a
commit
86fc6e69ff
|
@ -82,8 +82,8 @@ pub fn generate(enum_args: &args::Enum, input: &DeriveInput) -> Result<TokenStre
|
|||
}
|
||||
|
||||
impl #crate_name::Type for #ident {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
fn create_type_info(registry: &mut #crate_name::registry::Registry) -> String {
|
||||
|
|
|
@ -100,8 +100,8 @@ pub fn generate(object_args: &args::InputObject, input: &DeriveInput) -> Result<
|
|||
|
||||
let expanded = quote! {
|
||||
impl #crate_name::Type for #ident {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
fn create_type_info(registry: &mut #crate_name::registry::Registry) -> String {
|
||||
|
@ -130,7 +130,7 @@ pub fn generate(object_args: &args::InputObject, input: &DeriveInput) -> Result<
|
|||
}
|
||||
|
||||
fn to_value(&self) -> #crate_name::Value {
|
||||
let mut map = std::collections::BTreeMap::new();
|
||||
let mut map = ::std::collections::BTreeMap::new();
|
||||
#(#put_fields)*
|
||||
#crate_name::Value::Object(map)
|
||||
}
|
||||
|
|
|
@ -268,11 +268,11 @@ pub fn generate(interface_args: &args::Interface, input: &DeriveInput) -> Result
|
|||
}
|
||||
|
||||
impl #generics #crate_name::Type for #ident #generics {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
fn introspection_type_name(&self) -> std::borrow::Cow<'static, str> {
|
||||
fn introspection_type_name(&self) -> ::std::borrow::Cow<'static, str> {
|
||||
#introspection_type_name
|
||||
}
|
||||
|
||||
|
|
|
@ -464,8 +464,8 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
#item_impl
|
||||
|
||||
impl #generics #crate_name::Type for #self_ty #where_clause {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
fn create_type_info(registry: &mut #crate_name::registry::Registry) -> String {
|
||||
|
|
|
@ -32,8 +32,8 @@ pub fn generate(scalar_args: &args::Scalar, item_impl: &mut ItemImpl) -> Result<
|
|||
#item_impl
|
||||
|
||||
impl #generic #crate_name::Type for #self_ty #where_clause {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
fn create_type_info(registry: &mut #crate_name::registry::Registry) -> String {
|
||||
|
|
|
@ -159,8 +159,8 @@ pub fn generate(object_args: &args::Object, input: &DeriveInput) -> Result<Token
|
|||
}
|
||||
|
||||
impl #generics #crate_name::Type for #ident #generics #where_clause {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
fn create_type_info(registry: &mut #crate_name::registry::Registry) -> String {
|
||||
|
|
|
@ -252,8 +252,8 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
|
||||
#(#get_params)*
|
||||
#guard
|
||||
let field_name = std::sync::Arc::new(ctx.result_name().to_string());
|
||||
let field = std::sync::Arc::new(ctx.item.clone());
|
||||
let field_name = ::std::sync::Arc::new(ctx.result_name().to_string());
|
||||
let field = ::std::sync::Arc::new(ctx.item.clone());
|
||||
|
||||
let pos = ctx.position();
|
||||
let schema_env = schema_env.clone();
|
||||
|
@ -266,7 +266,7 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
let field = field.clone();
|
||||
let field_name = field_name.clone();
|
||||
async move {
|
||||
let resolve_id = std::sync::atomic::AtomicUsize::default();
|
||||
let resolve_id = ::std::sync::atomic::AtomicUsize::default();
|
||||
let ctx_selection_set = query_env.create_context(
|
||||
&schema_env,
|
||||
Some(#crate_name::QueryPathNode {
|
||||
|
@ -311,8 +311,8 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
#item_impl
|
||||
|
||||
impl #generics #crate_name::Type for #self_ty #where_clause {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
#[allow(bare_trait_objects)]
|
||||
|
@ -342,7 +342,7 @@ pub fn generate(object_args: &args::Object, item_impl: &mut ItemImpl) -> Result<
|
|||
ctx: &#crate_name::Context<'_>,
|
||||
schema_env: #crate_name::SchemaEnv,
|
||||
query_env: #crate_name::QueryEnv,
|
||||
) -> #crate_name::Result<std::pin::Pin<Box<dyn #crate_name::futures::Stream<Item = #crate_name::Result<#crate_name::serde_json::Value>> + Send>>>
|
||||
) -> #crate_name::Result<::std::pin::Pin<Box<dyn #crate_name::futures::Stream<Item = #crate_name::Result<#crate_name::serde_json::Value>> + Send>>>
|
||||
where
|
||||
Self: Send + Sync + 'static + Sized,
|
||||
{
|
||||
|
|
|
@ -98,11 +98,11 @@ pub fn generate(union_args: &args::Interface, input: &DeriveInput) -> Result<Tok
|
|||
#(#type_into_impls)*
|
||||
|
||||
impl #generics #crate_name::Type for #ident #generics {
|
||||
fn type_name() -> std::borrow::Cow<'static, str> {
|
||||
std::borrow::Cow::Borrowed(#gql_typename)
|
||||
fn type_name() -> ::std::borrow::Cow<'static, str> {
|
||||
::std::borrow::Cow::Borrowed(#gql_typename)
|
||||
}
|
||||
|
||||
fn introspection_type_name(&self) -> std::borrow::Cow<'static, str> {
|
||||
fn introspection_type_name(&self) -> ::std::borrow::Cow<'static, str> {
|
||||
match self {
|
||||
#(#get_introspection_typename),*
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ pub fn parse_validator(crate_name: &TokenStream, args: &MetaList) -> Result<Toke
|
|||
));
|
||||
}
|
||||
let validator = parse_nested_validator(crate_name, &ls.nested[0])?;
|
||||
return Ok(quote! { Some(std::sync::Arc::new(#validator)) });
|
||||
return Ok(quote! { Some(::std::sync::Arc::new(#validator)) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ pub fn feature_block(
|
|||
quote!({
|
||||
#[cfg(not(all(#(feature = #features),*)))]
|
||||
{
|
||||
return Err(#crate_name::FieldError::from(#error_message)).map_err(std::convert::Into::into);
|
||||
return Err(#crate_name::FieldError::from(#error_message)).map_err(::std::convert::Into::into);
|
||||
}
|
||||
#[cfg(all(#(feature = #features),*))]
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user