Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
0.12.3 source code.tar.gz | 2020-03-17 | 104.5 kB | |
0.12.3 source code.zip | 2020-03-17 | 112.4 kB | |
README.md | 2020-03-17 | 836 Bytes | |
Totals: 3 Items | 217.8 kB | 0 |
- Improved macro syntax:
- Object
"key" => value
pair can be now written as either"key": value
orkey: value
without quotes, as long askey
is an identifier. - If you want to use the value of the a variable as a key in the new notation, use
[foo]: value
. - When nesting objects or arrays, it's no longer necessary to use invoke
array!
orobject!
from within another macro. null
is a keyword inside of either macro.- This is a backwards compatible change, although mixing notations within a single macro invocation is not permitted.
- Object
Example
Instead of:
:::rust
let obj = object! {
"foo" => array![1, 2, json::Null],
"bar" => 42
};
You can now write:
:::rust
let obj = object! {
foo: [1, 2, null],
bar: 42
};