From cecf2d760b8d4445963d0c7e95ce3b4629f87305 Mon Sep 17 00:00:00 2001 From: Jaysonmaw <55055180+jaysonmaw@users.noreply.github.com> Date: Sat, 15 Jul 2023 19:56:21 -0500 Subject: [PATCH] Fix #[derive(Debug,PartialEq,Eq)] no longer working --- ouroboros_macro/src/parse.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ouroboros_macro/src/parse.rs b/ouroboros_macro/src/parse.rs index b035516..eb6174e 100644 --- a/ouroboros_macro/src/parse.rs +++ b/ouroboros_macro/src/parse.rs @@ -119,20 +119,13 @@ fn parse_derive_attribute(attr: &Attribute) -> Result, Error> { Meta::List(ml) => &ml.tokens, _ => unreachable!(), }; - if let Some(TokenTree::Group(body)) = body.clone().into_iter().next() { - if body.delimiter() != Delimiter::Parenthesis { - panic!("TODO: nice error, bad define syntax") - } - let mut derives = Vec::new(); - for token in body.stream().into_iter() { - if let Some(derive) = parse_derive_token(&token)? { - derives.push(derive); - } + let mut derives = Vec::new(); + for token in body.clone().into_iter() { + if let Some(derive) = parse_derive_token(&token)? { + derives.push(derive); } - Ok(derives) - } else { - Err(Error::new(attr.span(), "bad syntax")) } + Ok(derives) } pub fn parse_struct(def: &ItemStruct) -> Result {