From 8b91a83fbb7a2fa33ab8ce4a79c413cd0a3f6eb1 Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Mon, 17 Jul 2017 00:43:23 -0700 Subject: cleanup as i learn serde_json --- main.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main.rs b/main.rs index 6efd9a5..7b16588 100644 --- a/main.rs +++ b/main.rs @@ -61,12 +61,7 @@ fn render_tweet(structure: serde_json::Map) { 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(); -- cgit v1.1