Skip to content

Commit

Permalink
Fix #[derive(Debug,PartialEq,Eq)] no longer working
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysonmaw committed Jul 16, 2023
1 parent 6758532 commit cecf2d7
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions ouroboros_macro/src/parse.rs
Expand Up @@ -119,20 +119,13 @@ fn parse_derive_attribute(attr: &Attribute) -> Result<Vec<Derive>, 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<StructInfo, Error> {
Expand Down

0 comments on commit cecf2d7

Please sign in to comment.