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

Better macros #175

Merged
merged 4 commits into from
Mar 17, 2020
Merged

Better macros #175

merged 4 commits into from
Mar 17, 2020

Conversation

maciejhirsz
Copy link
Owner

  • Improved macro syntax.

Instead of:

let obj = object! {
    "foo" => array![1, 2, json::Null],
    "bar" => 42
};

Macros now support following, compact syntax:

let obj = object! {
    "foo": [1, 2, null],
    bar: 42 // quotes on keys are optional
};

This is a backwards compatible change, old macro use will continue to work. Mixing => and : style objects will lead to compile errors, it's either the new style or the old one.

@maciejhirsz maciejhirsz changed the title 0.13.0 Better macros Mar 17, 2020
@maciejhirsz
Copy link
Owner Author

0.13 is going to introduce major breaking changes, and it might make it easier to manage if all the macros and tests aren't also modified from last stable release.

Since this is a reasonably big feature, but it is still mostly surface quality of life stuff, and it's backwards compatible, gonna roll this out as 0.12.3.

@maciejhirsz maciejhirsz merged commit b99d38d into master Mar 17, 2020
@maciejhirsz maciejhirsz deleted the better-macros branch March 17, 2020 11:04
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.

1 participant