Improve docs on JSON.

- add one simple example of using `ToJson` trait
- make example code more readable
auto merge of #15675 : errordeveloper/rust/json_docs, r=steveklabnik

- add one simple example of using `ToJson` trait
- make example code more readable