2020/05/06

How tokio join macro works

tokio's join macro is pretty amazing

To find out how this join! macro works exactly,  you can do blow to expand the macro to see exact code generated.
rustup toolchain install nightly
cargo install cargo-expand

then in your project
cargo expand
You will find the expanded code like below

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.


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:...