From 3e488ad535a8490d7c039dbaa48993143e6ae467 Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 17 Oct 2017 02:33:59 -0700 Subject: add rudimentary thread support --- src/display/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/display') 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 { -- cgit v1.1