3 ms·
> Are all those lambdas to walk the tree down to the field you want so that it doesn’t have to parse all the bytes you don’t care about? Is it the efficiency of
by mustache_kimono 2y ago
> Are all those lambdas to walk the tree down to the field you want so that it doesn’t have to parse all the bytes you don’t care about? Is it the efficiency of SAX without being horrible to read and write?
Just the ugly/simple-minded way I wrote it.
You can index into JSON with serde too, like so:
let wealth_str: &str = data["user"]["wealth"].as_str().expect("Could not parse JSON value.");
See: https://docs.rs/serde_json/latest/serde_json/value/trait.Index.html https://docs.rs/serde_json/latest/serde_json/value/trait.Ind...
- pkulak 2y agoAh, gotcha, thanks.