aboutsummaryrefslogtreecommitdiff
path: root/src/display
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2017-10-18 22:28:28 -0700
committeriximeow <me@iximeow.net>2017-10-18 22:28:28 -0700
commit662d2a78c39bff7b56b81448a15a179b2af2b000 (patch)
treeec11fd55c8e0323d76d632fb23d996305cf6580b /src/display
parent3e488ad535a8490d7c039dbaa48993143e6ae467 (diff)
lots of tiny tweaks
escape more stuff avoid possible breakage if we dont have the fav of a retweet
Diffstat (limited to 'src/display')
-rw-r--r--src/display/mod.rs7
1 files changed, 5 insertions, 2 deletions
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 } => {