summaryrefslogtreecommitdiff
path: root/dhall_proc_macros
diff options
context:
space:
mode:
authorNadrieril2019-08-12 23:24:48 +0200
committerNadrieril2019-08-13 14:24:56 +0200
commit52f9ecfc4dac65d305fd920e8c7f748889a0804f (patch)
tree106a54c066d1a38e99a73644f0b8f20df280b7e7 /dhall_proc_macros
parent7d17d39005531cb77d8eaf32ed7de8938c66f874 (diff)
Move api into its own crate
Diffstat (limited to 'dhall_proc_macros')
-rw-r--r--dhall_proc_macros/src/derive.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/dhall_proc_macros/src/derive.rs b/dhall_proc_macros/src/derive.rs
index 725cdfb..0ebfe7d 100644
--- a/dhall_proc_macros/src/derive.rs
+++ b/dhall_proc_macros/src/derive.rs
@@ -18,7 +18,7 @@ where
T: quote::ToTokens,
{
quote!(
- <#ty as ::dhall::de::StaticType>::static_type()
+ <#ty as ::serde_dhall::de::StaticType>::static_type()
)
}
@@ -53,7 +53,7 @@ fn derive_for_struct(
let ty = static_type(ty);
quote!( (#name.to_owned(), #ty) )
});
- Ok(quote! { ::dhall::de::Type::make_record_type(
+ Ok(quote! { ::serde_dhall::de::Type::make_record_type(
vec![ #(#entries),* ].into_iter()
) })
}
@@ -90,7 +90,7 @@ fn derive_for_enum(
})
.collect::<Result<_, Error>>()?;
- Ok(quote! { ::dhall::de::Type::make_union_type(
+ Ok(quote! { ::serde_dhall::de::Type::make_union_type(
vec![ #(#entries),* ].into_iter()
) })
}
@@ -134,7 +134,7 @@ pub fn derive_static_type_inner(
let mut local_where_clause = orig_where_clause.clone();
local_where_clause
.predicates
- .push(parse_quote!(#ty: ::dhall::de::StaticType));
+ .push(parse_quote!(#ty: ::serde_dhall::de::StaticType));
let phantoms = generics.params.iter().map(|param| match param {
syn::GenericParam::Type(syn::TypeParam { ident, .. }) => {
quote!(#ident)
@@ -156,16 +156,16 @@ pub fn derive_static_type_inner(
for ty in constraints.iter() {
where_clause
.predicates
- .push(parse_quote!(#ty: ::dhall::de::StaticType));
+ .push(parse_quote!(#ty: ::serde_dhall::de::StaticType));
}
let ident = &input.ident;
let tokens = quote! {
- impl #impl_generics ::dhall::de::StaticType
+ impl #impl_generics ::serde_dhall::de::StaticType
for #ident #ty_generics
#where_clause {
fn static_type() ->
- ::dhall::de::Type {
+ ::serde_dhall::de::Type {
#(#assertions)*
#get_type
}