2020/05/05

Usage of serde_json


Some sample code shows behavior of serde_json.

I used to write code like

val.as_object().unwrap().get("field_name").unwrap().as_object().unwrap().get_("sub_field_name").as_str().unwrap().

Turns out that using index of serde_json makes code much less verbose.


No comments:

Post a Comment

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...