v0.5.0
New Features
-
Compiling with the
preserve_orderfeature will use anIndexMapinstead of aHashMapfor compound tags, which preserves insertion order when serializing. (#54 by @samlich) -
Structs can now be explicitly told to serialize as byte/int/long arrays instead of a list under Serde by using
serialize_withand the newi8_array(),i32_array(), andi64_array()functions. (#51, #52, and #53 by @Schuwi). For example:
#[derive(Serialize)]
struct MyStruct {
#[serde(serialize_with="hematite_nbt::i8_array")]
byte_array: Vec<i8>,
}
-
Blobnow has alen_bytes()method to compute the expected length when serialized, restoring functionality removed in #36. It turns out to be helpful to know the length when writing NBT payloads into network packets. (#48 by @ejmount) -
Blobnow has aget()method to get values by name; previously this was only possible via indexing, which would panic if the key was absent. (#44 by @vlakreeh) -
Blobnow implementsDefault::default(), as suggested by Clippy.
Bug Fixes and Other Improvements
-
The
flate2dependency has been bumped to enable compilation for WASM. (#56 by @oOBoomberOo) -
The use of various deprecated APIs in the Rust standard library has been fixed, so consumers of this crate will no longer see build warnings. (#49 by @atheriel)
-
UnrepresentableTypewill now correctly show the type in the error message, instead of the literal string$type. (#47 by @caelunshun) -
The benchmark suite has been rewritten to use Criterion, so it should compile with stable Rust. However, it's not clear that the black-box benchmarks are actually working properly at this time.
-
The project now uses and enforces
rustfmtrules.