Add a helper macro for parsing firefly.toml into Rust helper methods and types#23
Closed
oli-obk wants to merge 1 commit intofirefly-zero:mainfrom
Closed
Add a helper macro for parsing firefly.toml into Rust helper methods and types#23oli-obk wants to merge 1 commit intofirefly-zero:mainfrom
firefly.toml into Rust helper methods and types#23oli-obk wants to merge 1 commit intofirefly-zero:mainfrom
Conversation
896d22f to
5d882a7
Compare
Member
|
Thank you! Moved to a separate crate: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I duplicated the toml data structures (they also exist in
firefly-cli). While I think long term it would be good to deduplicate them, I didn't know whether/how you'd want that to be done, so I started out this way.cheats produce a
Cheatenum with a variant per cheat. The intended use case isboards and badges produce a module with a method per board/badge. You can invoke them with
boards::board_name(peer, score)orbadges::the_badge(peer)to set them. If the badge's steps are not set (or1), then there is no second argument for the badge function. Otherwise there is an argument for setting the progress.I added unit tests, which both test that the resulting code compiles and show what the code looks like. It is ugly, but no one ever sees it (tho I could run rustfmt on it if you want). This causes a funny cyclic dependency where
firefly-rustcan depend onfirefly-toml, whose tests again depend onfirefly-rust