From 41f6535a480bb9b0ff085e0144852827633f2305 Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Wed, 1 Nov 2017 04:31:43 -0700 Subject: move more logging to be through DisplayInfo statuses move DisplayInfo into ... display flush output, duh --- src/commands/show_cache.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/commands/show_cache.rs') diff --git a/src/commands/show_cache.rs b/src/commands/show_cache.rs index 3c31697..59ecfc2 100644 --- a/src/commands/show_cache.rs +++ b/src/commands/show_cache.rs @@ -9,23 +9,23 @@ pub static SHOW_CACHE: Command = Command { exec: show_cache }; -fn show_cache(line: String, tweeter: &mut tw::TwitterCache, mut queryer: &mut Queryer) { - println!("----* USERS *----"); +fn show_cache(_line: String, tweeter: &mut tw::TwitterCache, mut queryer: &mut Queryer) { + tweeter.display_info.status("----* USERS *----".to_owned()); for (uid, user) in &tweeter.users { - println!("User: {} -> {:?}", uid, user); + tweeter.display_info.status(format!("User: {} -> {:?}", uid, user)); } - println!("----* TWEETS *----"); + tweeter.display_info.status("----* TWEETS *----".to_owned()); for (tid, tweet) in &tweeter.tweets { - println!("Tweet: {} -> {:?}", tid, tweet); + tweeter.display_info.status(format!("Tweet: {} -> {:?}", tid, tweet)); } - println!("----* FOLLOWERS *----"); + tweeter.display_info.status("----* FOLLOWERS *----".to_owned()); for uid in &tweeter.followers.clone() { - let user_res = tweeter.fetch_user(uid, &mut queryer); + let user_res = tweeter.fetch_user(uid, &mut queryer).map(|x| x.clone()); match user_res { Some(user) => { - println!("Follower: {} - {:?}", uid, user); + tweeter.display_info.status(format!("Follower: {} - {:?}", uid, user)); } - None => { println!(" ..."); } + None => { tweeter.display_info.status(" ...".to_owned()); } } } } -- cgit v1.1