From 695f90bf900015df1e2728445f833dabced838a9 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 24 Sep 2022 13:13:20 +0200 Subject: refactor: reorganize modules in the macros crate --- macros/src/factory_type_alias.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 macros/src/factory_type_alias.rs (limited to 'macros/src/factory_type_alias.rs') diff --git a/macros/src/factory_type_alias.rs b/macros/src/factory_type_alias.rs deleted file mode 100644 index 64afe57..0000000 --- a/macros/src/factory_type_alias.rs +++ /dev/null @@ -1,35 +0,0 @@ -use quote::ToTokens; -use syn::parse::{Parse, ParseStream}; -use syn::punctuated::Punctuated; -use syn::{parse, ItemType, Token, Type}; - -use crate::fn_trait::FnTrait; - -pub struct FactoryTypeAlias -{ - pub type_alias: ItemType, - pub factory_interface: FnTrait, - pub arg_types: Punctuated, - pub return_type: Type, -} - -impl Parse for FactoryTypeAlias -{ - fn parse(input: ParseStream) -> syn::Result - { - let type_alias = match input.parse::() { - Ok(type_alias) => Ok(type_alias), - Err(_) => Err(input.error("Expected a type alias")), - }?; - - let aliased_fn_trait = - parse::(type_alias.ty.as_ref().to_token_stream().into())?; - - Ok(Self { - type_alias, - factory_interface: aliased_fn_trait.clone(), - arg_types: aliased_fn_trait.inputs, - return_type: aliased_fn_trait.output, - }) - } -} -- cgit v1.2.3-18-g5258