From b31cd05328e78f01ec053a8ff60b6db8a92891a1 Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Wed, 18 Oct 2017 22:28:28 -0700 Subject: lots of tiny tweaks escape more stuff avoid possible breakage if we dont have the fav of a retweet --- src/display/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/display') diff --git a/src/display/mod.rs b/src/display/mod.rs index aaca4b2..15e23d7 100644 --- a/src/display/mod.rs +++ b/src/display/mod.rs @@ -62,8 +62,11 @@ impl Render for tw::events::Event { }, tw::events::Event::Fav_RT { user_id, twete_id } => { println!("---------------------------------"); - let user = tweeter.retrieve_user(&user_id).unwrap(); - println!(" +rt_fav : {} (@{})", user.name, user.handle); + if let Some(user) = tweeter.retrieve_user(&user_id) { + println!(" +rt_fav : {} (@{})", user.name, user.handle); + } else { + println!(" +rt_fav but don't know who {} is", user_id); + } render_twete(&twete_id, tweeter); }, tw::events::Event::Fav { user_id, twete_id } => { -- cgit v1.1