diff options
author | iximeow <me@iximeow.net> | 2017-10-17 02:33:59 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2017-10-17 02:33:59 -0700 |
commit | 3e488ad535a8490d7c039dbaa48993143e6ae467 (patch) | |
tree | 1c6312dd3f1f8cc30ec9dcfff944bb1274bf15e3 /src/display | |
parent | 9a50ccba1c77cba504b7458e144e6fc5d10b55d1 (diff) |
add rudimentary thread support
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/mod.rs | 7 |
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 { |