Releases: maciejhirsz/json-rust
Releases · maciejhirsz/json-rust
0.12.4
0.12.3
- 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:
let obj = object! {
"foo" => array![1, 2, json::Null],
"bar" => 42
};
You can now write:
let obj = object! {
foo: [1, 2, null],
bar: 42
};
0.12.2
0.12.1
0.12.0
- Updated to edition 2018.
- Simplified reading escaped unicode in strings a bit.
- Provided
From<&[T]>
implementation forJsonValue
whereT: Into<JsonValue>
(closes #160). object!
andarray!
macros will no longer re-allocate (closes #159).object!
andarray!
macros can be now used without being imported into local scope (by usingjson::object!
orjson::array!
, thanks @matthias-t).- BREAKING
HashMap
andBTreeMap
conversions are now more generic, working for any pair ofK
key andV
value whereK: AsRef<str>
andV: Into<JsonValue>
. This means that type inference won't always work in your favor, but should be much more flexible. - You can now
.collect()
an interator of(K, V)
(with bounds same as point above) into anObject
.
0.11.13
0.11.12
- Optimized away unnecessary copying in the parser stack machine, should result in parsing performance increased by up to 20%.