allows for empty toml::toml! invocations#398
Open
sanbox-irl wants to merge 1 commit intotoml-rs:mainfrom
Open
Conversation
epage
reviewed
Dec 21, 2022
Member
epage
left a comment
There was a problem hiding this comment.
As a heads up, I'm trying to hold off on releasing 0.6 (master) without some specific changes. What we can do, once this is merged, is you can submit another PR that cherry-picks this commit to the toml-v0.5 branch and I can release that.
| #[macro_export] | ||
| macro_rules! toml { | ||
| ($($toml:tt)+) => {{ | ||
| ($($toml:tt)*) => {{ |
Member
There was a problem hiding this comment.
Could you add a test case for empty tables?
Author
|
sounds great -- not sure i'm following re: cherry picking, but that's a future problem, for the future |
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 don't know too much about macros, so perhaps this is too noisy a change, but this simply allows calling
toml::toml!{}without anything inside it, creating a blanktoml::Value::Table.In unit tests, it can read more clearly for an empty toml document when other tests nearby are constructing real data, and it has a very small footprint, so it doesn't seem like an issue in general.