Skip to content

Releases: maciejhirsz/json-rust

0.12.4

18 Mar 08:40
752f942
Compare
Choose a tag to compare
  • Fixes an issue with new macros requiring types to be copy.

0.12.3

17 Mar 11:14
b99d38d
Compare
Choose a tag to compare
  • Improved macro syntax:
    • Object "key" => value pair can be now written as either "key": value or key: value without quotes, as long as key 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! or object! 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.

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

11 Mar 09:12
91c6da6
Compare
Choose a tag to compare
  • Fixes #152 & #153.
  • Fixed a whole bunch of warnings and some formatting.

0.12.1

14 Jan 10:26
bbca97e
Compare
Choose a tag to compare
  • Fixes panics in string generation (#168).
  • Fixes an old link to documentation in doc comments (#170).

0.12.0

06 Sep 16:45
2a57273
Compare
Choose a tag to compare
  • Updated to edition 2018.
  • Simplified reading escaped unicode in strings a bit.
  • Provided From<&[T]> implementation for JsonValue where T: Into<JsonValue> (closes #160).
  • object! and array! macros will no longer re-allocate (closes #159).
  • object! and array! macros can be now used without being imported into local scope (by using json::object! or json::array!, thanks @matthias-t).
  • BREAKING HashMap and BTreeMap conversions are now more generic, working for any pair of K key and V value where K: AsRef<str> and V: 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 an Object.

0.11.13

17 Jan 15:44
Compare
Choose a tag to compare
  • Fixes an overflow that lead to a panic in extremely large integers (see issue #139).

0.11.12

10 Nov 17:31
Compare
Choose a tag to compare
  • Optimized away unnecessary copying in the parser stack machine, should result in parsing performance increased by up to 20%.

0.11.11

10 Nov 15:47
Compare
Choose a tag to compare
  • Fixes an issue when parsing objects with non-unique names (#136).
  • Fixed a warning on #[must_use] (#119).
  • Deprecated Object::override_last, it was only public out of necessity before pub(crate) was introduced.

0.11.10

07 Oct 13:10
Compare
Choose a tag to compare

Thanks to @Yoric for contributions:

  • Implemented dump and pretty for Object, see #131
  • Two string JsonValues are now equal even if one is a Short while the other is a String variant, see #126
  • The object! macro now handles trailing commas, see #125

0.11.9

28 Jul 10:10
Compare
Choose a tag to compare
  • Numbers created from parts are now automatically normalized, and print out expected values (Issue #114, thanks again @lpbak).