diff options
Diffstat (limited to 'src/pin_project/mod.rs')
-rw-r--r-- | src/pin_project/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pin_project/mod.rs b/src/pin_project/mod.rs index 380b586..2dce78f 100644 --- a/src/pin_project/mod.rs +++ b/src/pin_project/mod.rs @@ -3,14 +3,15 @@ mod attribute; mod derive; use proc_macro2::TokenStream; +use syn::Error; /// The annotation for pinned type. const PIN: &str = "pin"; pub(crate) fn attribute(args: &TokenStream, input: TokenStream) -> TokenStream { - attribute::parse_attribute(args, input).unwrap_or_else(|e| e.to_compile_error()) + attribute::parse_attribute(args, input).unwrap_or_else(Error::into_compile_error) } pub(crate) fn derive(input: TokenStream) -> TokenStream { - derive::parse_derive(input).unwrap_or_else(|e| e.to_compile_error()) + derive::parse_derive(input).unwrap_or_else(Error::into_compile_error) } |