diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-12-02 21:40:41 -0800 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-12-02 21:40:41 -0800 |
commit | 6ae94473e31c0f7d2c1ca79294f529419f1c536f (patch) | |
tree | cea89b2fbcaa44872a7d458a12981080d558daa2 /src/commands | |
parent | f74ece81c99d94c2b5250d7fd7fde0d1df15cbeb (diff) |
track dirty bit to know if we should redraw display
also clean up a bunch of TODOs
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/fav.rs | 4 | ||||
-rw-r--r-- | src/commands/profile.rs | 3 | ||||
-rw-r--r-- | src/commands/twete.rs | 4 |
3 files changed, 4 insertions, 7 deletions
diff --git a/src/commands/fav.rs b/src/commands/fav.rs index 5e5f2a2..02ec7dd 100644 --- a/src/commands/fav.rs +++ b/src/commands/fav.rs @@ -21,7 +21,7 @@ fn unfav(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer, di let maybe_id = TweetId::parse(line.to_owned()); match maybe_id { Ok(twid) => { - if let Some(twete) = tweeter.retrieve_tweet(&twid).map(|x| x.clone()) { // TODO: no clone when this stops taking &mut self + if let Some(twete) = tweeter.retrieve_tweet(&twid) { let result = match tweeter.current_profile() { Some(user_profile) => queryer.do_api_post(&format!("{}?id={}", UNFAV_TWEET_URL, twete.id), &tweeter.app_key, &user_profile.creds), None => Err("No logged in user to unfav from".to_owned()) @@ -53,7 +53,7 @@ fn fav(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer, disp match maybe_id { Ok(twid) => { // tweeter.to_twitter_tweet_id(twid)... - if let Some(twete) = tweeter.retrieve_tweet(&twid).map(|x| x.clone()) { // TODO: no clone when this stops taking &mut self + if let Some(twete) = tweeter.retrieve_tweet(&twid) { let result = match tweeter.current_profile() { Some(user_profile) => queryer.do_api_post(&format!("{}?id={}", FAV_TWEET_URL, twete.id), &tweeter.app_key, &user_profile.creds), None => Err("No logged in user to fav from".to_owned()) diff --git a/src/commands/profile.rs b/src/commands/profile.rs index e20859b..f3bfd8d 100644 --- a/src/commands/profile.rs +++ b/src/commands/profile.rs @@ -1,8 +1,5 @@ use display::DisplayInfo; use tw; -use std; -use std::collections::HashMap; -use hyper; use ::Queryer; use commands::Command; diff --git a/src/commands/twete.rs b/src/commands/twete.rs index ebf3c3d..d727b9e 100644 --- a/src/commands/twete.rs +++ b/src/commands/twete.rs @@ -54,7 +54,7 @@ fn twete(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer, di // if it's just "t", enter compose mode. let text = line.trim().to_owned(); if text.len() == 0 { - display_info.mode = Some(::display::DisplayMode::Compose(text)); + display_info.set_mode(Some(::display::DisplayMode::Compose(text))); } else { send_twete(text, tweeter, queryer, display_info); } @@ -178,7 +178,7 @@ fn rep(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer, disp if reply.len() > 0 { send_reply(full_reply, twid, tweeter, queryer, user_profile.creds, display_info); } else { - display_info.mode = Some(::display::DisplayMode::Reply(twid, full_reply)); + display_info.set_mode(Some(::display::DisplayMode::Reply(twid, full_reply))); } } else { display_info.status(format!("No tweet for id: {:?}", twid)); |