diff options
author | Andy Wortman <me@iximeow.net> | 2017-07-17 00:43:23 -0700 |
---|---|---|
committer | Andy Wortman <me@iximeow.net> | 2017-07-17 00:43:23 -0700 |
commit | 8b91a83fbb7a2fa33ab8ce4a79c413cd0a3f6eb1 (patch) | |
tree | a6a579112aa0aed9117547c2bc6623c001ead59c | |
parent | 93cb77eb29c3e8b76694b5a11b6c1c3d469ae8db (diff) |
cleanup as i learn serde_json
-rw-r--r-- | main.rs | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -61,12 +61,7 @@ fn render_tweet(structure: serde_json::Map<String, serde_json::Value>) { let source_screen_name = twete["user"]["screen_name"].as_str().unwrap(); if twete.contains_key("retweeted_status") { // render RT, actually - match &twete["retweeted_status"] { - // v--- why is it permissible to write "ref" here? does - // this take a ref of `value`? - &serde_json::Value::Object(ref value) => twete = value, - f => panic!(" o no, wrong type of thing! {}", f) - } + twete = twete["retweeted_status"].as_object().unwrap(); let author_name = twete["user"]["name"].as_str().unwrap(); let author_screen_name = twete["user"]["screen_name"].as_str().unwrap(); |