From 04c72976ad8cc8eb24a3e615972e18efa3669852 Mon Sep 17 00:00:00 2001 From: Douman Date: Sat, 21 Oct 2017 21:58:03 +0300 Subject: [PATCH] Adjust stdout to the same style --- src/api/gab.rs | 2 +- src/api/twitter.rs | 2 +- src/main.rs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/gab.rs b/src/api/gab.rs index a7bac8f..0191735 100644 --- a/src/api/gab.rs +++ b/src/api/gab.rs @@ -89,7 +89,7 @@ impl Client { return Err(format!("Failed to post. Status: {}", response.status())); } - println!("Posted gab"); + println!("OK"); Ok(()) } } diff --git a/src/api/twitter.rs b/src/api/twitter.rs index fb07ac5..f426b86 100644 --- a/src/api/twitter.rs +++ b/src/api/twitter.rs @@ -44,6 +44,6 @@ impl Client { } pub fn handle_post(response: Response) -> Result<(), String> { - Ok(println!("Posted tweet(id={}):\n{}\n", response.response.id, response.response.text)) + Ok(println!("OK(id={})", response.response.id)) } } diff --git a/src/main.rs b/src/main.rs index 38c1fc2..00f376d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,9 @@ fn run() -> Result { 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))? }, }