From b9547026cb70ac407aaae79920f623bd66c57c34 Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Sat, 21 Oct 2017 14:02:56 -0700 Subject: do not return tweet text before unescaping some html-encoded values --- src/tw/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tw/mod.rs b/src/tw/mod.rs index daf1088..28f4ff0 100644 --- a/src/tw/mod.rs +++ b/src/tw/mod.rs @@ -34,18 +34,17 @@ pub fn full_twete_text(twete: &serde_json::map::Map) let full_text = extended_tweet.get("full_text"); match full_text { Some(text) => { - return text.as_str().unwrap().to_string() + text.as_str().unwrap().to_string() } None => { - println!("Missing extended_tweet text. Full extended_tweet json: {:?}", full_text); + panic!("Missing extended_tweet text. Full extended_tweet json: {:?}", full_text); } } }, None => { - println!("Missing extended text. Full tweet json: {:?}", twete); + panic!("Missing extended text. Full tweet json: {:?}", twete); } } - panic!("API bug? changed?"); } else { match twete.get("text") { Some(text) => text.as_str().unwrap().to_string(), -- cgit v1.1