aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wortman <me@iximeow.net>2017-07-17 00:43:23 -0700
committerAndy Wortman <me@iximeow.net>2017-07-17 00:43:23 -0700
commit8b91a83fbb7a2fa33ab8ce4a79c413cd0a3f6eb1 (patch)
treea6a579112aa0aed9117547c2bc6623c001ead59c
parent93cb77eb29c3e8b76694b5a11b6c1c3d469ae8db (diff)
cleanup as i learn serde_json
-rw-r--r--main.rs7
1 files changed, 1 insertions, 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<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();