Use 2018-style paths in code generated by style_derive

This commit is contained in:
Simon Sapin 2018-11-01 13:41:10 +01:00
parent b60006ae11
commit ede79a6a5d
9 changed files with 65 additions and 65 deletions

View file

@ -16,7 +16,7 @@ pub fn derive(mut input: syn::DeriveInput) -> quote::Tokens {
if !no_bound.contains(&param.ident) {
cg::add_predicate(
&mut where_clause,
parse_quote!(#param: ::values::animated::ToAnimatedZero),
parse_quote!(#param: crate::values::animated::ToAnimatedZero),
);
}
}
@ -33,12 +33,12 @@ pub fn derive(mut input: syn::DeriveInput) -> quote::Tokens {
let field_attrs = cg::parse_field_attrs::<AnimationFieldAttrs>(&binding.ast());
if field_attrs.constant {
quote! {
let #mapped_binding = ::std::clone::Clone::clone(#binding);
let #mapped_binding = std::clone::Clone::clone(#binding);
}
} else {
quote! {
let #mapped_binding =
::values::animated::ToAnimatedZero::to_animated_zero(#binding)?;
crate::values::animated::ToAnimatedZero::to_animated_zero(#binding)?;
}
}
}));
@ -51,7 +51,7 @@ pub fn derive(mut input: syn::DeriveInput) -> quote::Tokens {
let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
quote! {
impl #impl_generics ::values::animated::ToAnimatedZero for #name #ty_generics #where_clause {
impl #impl_generics crate::values::animated::ToAnimatedZero for #name #ty_generics #where_clause {
#[allow(unused_variables)]
#[inline]
fn to_animated_zero(&self) -> Result<Self, ()> {