Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allows for empty toml::toml! invocations #398

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sanbox-irl
Copy link

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 blank toml::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.

Copy link
Member

@epage epage left a comment

Choose a reason for hiding this comment

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

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.

@@ -28,10 +28,13 @@ use crate::value::{Array, Table, Value};
/// ```
#[macro_export]
macro_rules! toml {
($($toml:tt)+) => {{
($($toml:tt)*) => {{
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test case for empty tables?

@sanbox-irl
Copy link
Author

sounds great -- not sure i'm following re: cherry picking, but that's a future problem, for the future

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