Skip to content

Implement macro to simplify enum types - #379

Merged
teisenbe merged 3 commits into
mainfrom
enum-macro
Nov 11, 2021
Merged

teisenbe merged 3 commits into
mainfrom
enum-macro

Conversation

@teisenbe

Copy link
Copy Markdown
Contributor

This is a workaround for #312

@teisenbe
teisenbe requested a review from just-be-dev November 10, 2021 21:22
@teisenbe
teisenbe marked this pull request as draft November 10, 2021 21:57
Comment thread nexus/src/db/model.rs Resolved

@just-be-dev just-be-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wish there was some form of reflection 😞. This is a really clever piece of macro work @teisenbe. I wouldn't have thought about dropping the variants in the the body like that.

Comment thread nexus/src/db/model.rs Resolved
@teisenbe
teisenbe marked this pull request as ready for review November 11, 2021 01:43
@teisenbe

teisenbe commented Nov 11, 2021 •

Copy link
Copy Markdown
Contributor Author

I really wish there was some form of reflection disappointed. This is a really clever piece of macro work @teisenbe. I wouldn't have thought about dropping the variants in the the body like that.

You can get reflection with procedural macros, but it felt kind of heavy handed for this. This is actually the first non-trivial declarative macro I've written, so any cleverness is due to guides I read :)

@teisenbe
teisenbe merged commit 927ee36 into main Nov 11, 2021
@teisenbe
teisenbe deleted the enum-macro branch November 11, 2021 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants