Releases: maciejhirsz/json-rust
0.8.2
Just a tweak to get more performance out of the serializer.
0.8.1
This release increases the performance of both parsing and serialization.
There are also some minor fixes to how UTF8 is handled, particularly unexpected unicode characters are now properly reported:
#[test]
fn error_unexpected_unicode_character() {
let err = parse("\n\nnul🦄\n").unwrap_err();
assert_eq!(err, JsonError::UnexpectedCharacter {
ch: '🦄',
line: 3,
column: 4,
});
assert_eq!(format!("{}", err), "Unexpected character: 🦄 at (3:4)");
}
0.8.0
Breaking changes
- Minor, this release removes the
JsonError::UnexpectedToken
variant, as the tokenizer is no longer present. - All deprecated functions and methods have been removed.
No tokenizer
This version introduces a major overhaul of the parser. Initially, this project was born as a sidekick to a JavaScript parser of mine. Since JSON is a subset of JavaScript it was easy for me to reuse most of the parser and code generator.
The parser in HoneyBadger is, for very good reasons, using a separate tokenizer as an intermediate layer between source code and AST. JSON as it turns out is a very simple format, and having a tokenizer is very much an overkill. This release removes the tokenizer and makes the parser read directly from the byte source, which combined with a series of other tweaks increases parsing performance dramatically.
Much fix, very wow
Thanks to @dtolnay this release also includes a whole bunch of fixes to some edge cases of both the parser and code generator.
0.7.4
0.7.3
This is a minor release that slightly increases the performance of the parser and serializer, and contains a fix that allows JsonValue
to be indexed by String
and &String
on top of &str
.
0.7.2
Small bugfixes and convenience methods on JsonValue
:
Method | Description |
---|---|
is_empty |
Returns true if the value null , false , 0 , [] , {} , or "" . |
clear |
Clears the content of a string, array or object, noop otherwise. |
pop |
Remove and return last element of an array, null if not an array or empty. |
remove |
Remove a value from an object by key and return that element or null . |
All details available in the documentation.
0.7.1
Put some sweat into making the parser and serializer much faster.
No changes to API aside from one variant on the JsonError
enum being reworked.
0.7.0
This release deprecates the is
method and, in it's place, implements PartialEq
traits for JsonValue
. This makes the API a bit more intuitive, and there is some performance benefit as the implementations of PartialEq
are specialized per type and don't have to use Into<JsonValue>
.