diff options
author | HampusM <hampus@hampusmat.com> | 2024-06-06 12:22:19 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-06-06 12:22:19 +0200 |
commit | 43079a8dc9e2b608f47c5919f45c1f1661f11a2e (patch) | |
tree | 2e0c82f1db8c5e6ec0473402aa0eac36e3d0ae93 /ecs-macros | |
parent | 989bffa8ec39bf7421801129fb5b116c47ce8a35 (diff) |
chore(ecs-macros): remove component macro drop_last attribute
Diffstat (limited to 'ecs-macros')
-rw-r--r-- | ecs-macros/src/lib.rs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/ecs-macros/src/lib.rs b/ecs-macros/src/lib.rs index 2fd2c52..a3ddc2a 100644 --- a/ecs-macros/src/lib.rs +++ b/ecs-macros/src/lib.rs @@ -47,12 +47,6 @@ pub fn component_derive(input: TokenStream) -> TokenStream let item_ident = item.ident(); - let component_attr = item - .attribute::<ComponentAttribute>("component") - .unwrap_or_default(); - - let drop_last = component_attr.drop_last; - let (impl_generics, type_generics, where_clause) = item.generics().split_for_impl(); let ecs_path = find_engine_ecs_crate_path().unwrap_or_else(|| syn_path!(ecs)); @@ -65,11 +59,6 @@ pub fn component_derive(input: TokenStream) -> TokenStream type RefMut<'component> = #ecs_path::system::ComponentRefMut<'component, Self>; - fn drop_last(&self) -> bool - { - #drop_last - } - fn as_any_mut(&mut self) -> &mut dyn std::any::Any { self @@ -232,36 +221,6 @@ impl ToTokens for TypeItem } #[derive(Debug, Default)] -struct ComponentAttribute -{ - drop_last: bool, -} - -impl FromAttribute for ComponentAttribute -{ - fn from_attribute(attribute: &Attribute) -> Result<Self, syn::Error> - { - let mut drop_last = false; - - attribute.parse_nested_meta(|meta| { - if meta - .path - .get_ident() - .is_some_and(|flag| flag == "drop_last") - { - drop_last = true; - - return Ok(()); - } - - Err(meta.error("Unrecognized token")) - })?; - - Ok(Self { drop_last }) - } -} - -#[derive(Debug, Default)] struct SoleAttribute { drop_last: bool, |