$ criterion
v0.8.1Statistics-driven micro-benchmarking library
Latest Update Summary
Crate
Name: criterion New version: 0.8.0 Release date: 2025-11-30T00:12:50.151532Z
Crate readme
Short description JSON5 is a superset of JSON with an expanded syntax aimed at easier manual writing and maintenance.
Long description JSON5 allows comments, trailing commas, object keys without quotes, single quoted strings, hexadecimal numbers, and multi-line strings. The crate provides functions for deserializing JSON5 text into Rust datatypes and for serializing Rust datatypes as JSON5 text, utilizing the Serde framework.
Features • Deserialization and serialization of JSON5 via Serde • Supports comments and trailing commas • Allows object keys without quotes • Supports single quoted strings and hexadecimal numbers • Compatibility with Serde's data model for byte arrays
Code Examples Deserialization example
use serde_derive::Deserialize;
#[derive(Debug, PartialEq, Deserialize)]
struct Config<'a> {
foo: u32,
bar: &'a str,
}
let config: Config = json5::from_str("\n {\n // Note unquoted keys, comments, and trailing commas.\n foo: 42,\n bar: 'baz',\n }\n")?;
assert_eq!(config, Config{ foo: 42, bar: "baz" });
Serialization example
use serde_derive::Serialize;
#[derive(Serialize)]
struct Config<'a> {
foo: u32,
bar: &'a str,
}
let config = Config {
foo: 42,
bar: "baz",
};
assert_eq!(&json5::to_string(&config)?, "{\n foo: 42,\n bar: \"baz\",\n}");
Byte array example
use serde_bytes::{Bytes, ByteBuf};
let s = json5::to_string(&Bytes::new(b"JSON5"))?;
assert_eq!(&s, "\"4a534f4e35\"");
assert_eq!(json5::from_str::<ByteBuf>(&s)?, ByteBuf::from("JSON5"));
Links • https://crates.io/crates/json5 • https://docs.rs/json5
https://api.github.com/repos/criterion-rs/criterion.rs/releases/266168816
Release info
Release version:
Release description
Code Examples
Patch update: 0.8.0 → 0.8.1
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add criterionOr add to Cargo.toml: criterion = "0.8.1"