From 60e614f51eb3c41fc744b528c23dad77c1683867 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Thu, 26 Mar 2020 23:29:34 +0000 Subject: [PATCH] Nicer "failure only occured X ago" message --- Cargo.toml | 3 ++- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 01fc467..5fee20b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,4 +21,5 @@ async-std = "1" log = "0.4" regex = "1" scraper = "0.11" -chrono = { version = "0.4", features = ["serde"] } \ No newline at end of file +chrono = { version = "0.4", features = ["serde"] } +chrono-humanize = "0.0.11" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 769b615..884fb59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -352,7 +352,7 @@ async fn main() -> Result<(), Error> { println!("{:?}", link); failed +=1; } else { - println!("Failure occurred but only {} ago, so we're not worrying yet: {}", since, msg); + println!("Failure occurred but only {}, so we're not worrying yet: {}", chrono_humanize::HumanTime::from(-since), msg); } } }