Skip to content

Commit

Permalink
Adjust stdout to the same style
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Oct 21, 2017
1 parent 6897afa commit 04c7297
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/gab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl Client {
return Err(format!("Failed to post. Status: {}", response.status()));
}

println!("Posted gab");
println!("OK");
Ok(())
}
}
2 changes: 1 addition & 1 deletion src/api/twitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ impl Client {
}

pub fn handle_post(response: Response<tweet::Tweet>) -> Result<(), String> {
Ok(println!("Posted tweet(id={}):\n{}\n", response.response.id, response.response.text))
Ok(println!("OK(id={})", response.response.id))
}
}
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ fn run() -> Result<i32, String> {

match args.command {
cli::Commands::Post(message, tags) => {
println!(">>>Gab:");
tokio_core.run(gab.post(&message, &tags).map_err(error_formatter!("Cannot post.")).and_then(api::gab::Client::handle_post))?;
println!(">>>Twitter:");
tokio_core.run(twitter.post(&message, &tags).map_err(error_formatter!("Cannot tweet.")).and_then(api::twitter::Client::handle_post))?
},
}
Expand Down

0 comments on commit 04c7297

Please sign in to comment.