diff --git a/impl/src/expand.rs b/impl/src/expand.rs index 80a3978..394aafb 100644 --- a/impl/src/expand.rs +++ b/impl/src/expand.rs @@ -29,8 +29,8 @@ fn impl_struct(input: Struct) -> TokenStream { error_inferred_bounds.insert(only_field.ty, quote!(std::error::Error)); } let member = &only_field.member; - Some(quote_spanned! { - transparent_attr.span => std::error::Error::source(self.#member.as_dyn_error()) + Some(quote_spanned! {transparent_attr.span=> + std::error::Error::source(self.#member.as_dyn_error()) }) } else if let Some(source_field) = input.source_field() { let source = &source_field.member; @@ -43,8 +43,9 @@ fn impl_struct(input: Struct) -> TokenStream { } else { None }; - let dyn_error = - quote_spanned!(source_field.source_span() => self.#source #asref.as_dyn_error()); + let dyn_error = quote_spanned! {source_field.source_span()=> + self.#source #asref.as_dyn_error() + }; Some(quote! { ::core::option::Option::Some(#dyn_error) }) @@ -200,7 +201,9 @@ fn impl_enum(input: Enum) -> TokenStream { error_inferred_bounds.insert(only_field.ty, quote!(std::error::Error)); } let member = &only_field.member; - let source = quote_spanned!(transparent_attr.span => std::error::Error::source(transparent.as_dyn_error())); + let source = quote_spanned! {transparent_attr.span=> + std::error::Error::source(transparent.as_dyn_error()) + }; quote! { #ty::#ident {#member: transparent} => #source, } @@ -216,7 +219,9 @@ fn impl_enum(input: Enum) -> TokenStream { None }; let varsource = quote!(source); - let dyn_error = quote_spanned!(source_field.source_span()=> #varsource #asref.as_dyn_error()); + let dyn_error = quote_spanned! {source_field.source_span()=> + #varsource #asref.as_dyn_error() + }; quote! { #ty::#ident {#source: #varsource, ..} => ::core::option::Option::Some(#dyn_error), } diff --git a/impl/src/prop.rs b/impl/src/prop.rs index 62f269b..e4d2f18 100644 --- a/impl/src/prop.rs +++ b/impl/src/prop.rs @@ -1,6 +1,7 @@ use crate::ast::{Enum, Field, Struct, Variant}; use proc_macro2::Span; -use syn::{spanned::Spanned, Member, Type}; +use syn::spanned::Spanned; +use syn::{Member, Type}; impl Struct<'_> { pub(crate) fn from_field(&self) -> Option<&Field> {