aboutsummaryrefslogtreecommitdiff
path: root/src/display
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-17 02:33:59 -0700
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-17 02:33:59 -0700
commit2f2a76aab3f23baaf9a47a72b7660a64e2e156dc (patch)
tree1c6312dd3f1f8cc30ec9dcfff944bb1274bf15e3 /src/display
parentebe62b5ad92b60549deffd2d729c43134f93d96c (diff)
add rudimentary thread support
Diffstat (limited to 'src/display')
-rw-r--r--src/display/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/display/mod.rs b/src/display/mod.rs
index 3a48454..aaca4b2 100644
--- a/src/display/mod.rs
+++ b/src/display/mod.rs
@@ -99,7 +99,12 @@ impl Render for tw::events::Event {
pub fn render_twete(twete_id: &String, tweeter: &tw::TwitterCache) {
let id_color = color::Fg(color::Rgb(180, 80, 40));
- let twete = tweeter.retrieve_tweet(twete_id).unwrap();
+ let maybe_twete = tweeter.retrieve_tweet(twete_id);
+ if maybe_twete.is_none() {
+ println!("No such tweet: {}", twete_id);
+ return;
+ }
+ let twete = maybe_twete.unwrap();
// if we got the tweet, the API gave us the user too
let user = tweeter.retrieve_user(&twete.author_id).unwrap();
match twete.rt_tweet {