jstrict 0.14.0

Strict RFC 8259 / ECMA-404 JSON parser with source code mapping
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! This example shows how to convert a `serde_json::Value` into/from a
//! `jstrict::Value` using the `serde_json` feature.

fn main() {
	// First we create a `serde_json` value.
	let a = serde_json::json!({
		"foo": 1,
		"bar": [2, 3]
	});

	// We convert the `serde_json` value into a `jstrict` value.
	let b = jstrict::Value::from_serde_json(a);

	// We convert it back into a `serde_json` value.
	let _ = jstrict::Value::into_serde_json(b);
}