diff options
author | iximeow <me@iximeow.net> | 2017-10-21 14:02:56 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2017-10-21 14:02:56 -0700 |
commit | 5f3ebcf73f3df5f9993503b31d97b50f5f2901c0 (patch) | |
tree | 25b861690db87231307406d0dfa44588cf4d3db8 /src/tw | |
parent | 70cf5cc0d6e60706019f60dcda6bfa4baa959bf4 (diff) |
do not return tweet text before unescaping some html-encoded values
Diffstat (limited to 'src/tw')
-rw-r--r-- | src/tw/mod.rs | 7 |
1 files 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<String, serde_json::Value>) 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(), |