aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-21 14:02:56 -0700
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-21 14:02:56 -0700
commitb9547026cb70ac407aaae79920f623bd66c57c34 (patch)
tree25b861690db87231307406d0dfa44588cf4d3db8
parent79f626c9ea8e8503bd17c8ea640d8b192f0bbee5 (diff)
do not return tweet text before unescaping some html-encoded values
-rw-r--r--src/tw/mod.rs7
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(),