Crates.io | serde-json-utils |
lib.rs | serde-json-utils |
version | 0.2.1 |
source | src |
created_at | 2022-05-30 04:26:12.875204 |
updated_at | 2022-06-09 12:39:59.718481 |
description | Util crate for serde_json Value |
homepage | https://github.com/marirs/serde-json-utils |
repository | https://github.com/marirs/serde-json-utils |
max_upload_size | |
id | 596785 |
size | 20,771 |
Utility functions for serde_json::Value
. The functions are implemented as traits so all you need is to add the crate to your dependencies in your Cargo.toml
.
[dependencies]
serde-json-utils = "0.2.1"
const DATA: &str = r###"
[
{
"key1": null,
"key2": "there is a value",
"key3": {},
"key4": [],
"key5": [1, 2, 3, 3]
},
{
"key1": "value in here",
"key2": null
},
{
"key1": "value in here",
"key2": null
}
]
"###;
fn main() {
let mut val: Value = from_str(DATA).unwrap();
val.skip_null_and_empty();
println!("{:#?}", val);
}
License: MIT