someguynamedjosh / ouroboros

Easy self-referential struct generation for Rust.
Apache License 2.0
524 stars 33 forks source link

Fix #[derive(Debug,PartialEq,Eq)] no longer working #93

Closed jaysonmaw closed 1 year ago

jaysonmaw commented 1 year ago

Intended to fix #92

Seems that all the derive's were no longer working

The bug was introduced in b1cbf32

body previously would resolve to a stream of one TokenTree::Group with a stream inside but after this change body is a stream of TokenTree::Ident and TokenTree::Punct

Skipping the "unwrap" of the TokenTree::Group and sending the stream directly to parse_derive_token fixed the issue.

jaysonmaw commented 1 year ago

I also wonder if it would be a good idea to add a derive attribute onto one of the examples so that it will fail the tests? (Assuming that's how the CI works, I'm not familiar)

Could also state in the examples or docs that only those 3 derives work, unless I missed it I didn't know until I dug into the code to look for this bug.