julianandrews / sgf-parse

SGF parsing library for Rust.
MIT License
14 stars 3 forks source link

Use macros to clean up `props.rs` and `serialize.rs` #5

Closed julianandrews closed 4 years ago

julianandrews commented 4 years ago

Right now there's a ton of boilerplate going through all the enum values and doing largely the same thing. Some clever use of macros could probably remove hundreds of lines of code, and make the system less error-prone.

julianandrews commented 4 years ago

On further evaluation, I'm not finding a solution that's elegant enough to be worth doing.

I could use the strum or enum_derive crate to shear off some of the boilerplate, but I don't feel like the dependency is necessary worth the gain since neither would get rid of all the repetition anyway.