Create debug command, pretty print formatted tables

This commit is contained in:
timvisee 2018-05-17 16:29:51 +02:00
parent db1087c9e9
commit 7425c6c405
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2
13 changed files with 192 additions and 24 deletions

View file

@ -530,9 +530,9 @@ pub fn format_bytes(bytes: u64) -> String {
/// - `9m55s`
/// - `1s`
/// - `now`
pub fn format_duration(duration: &Duration) -> String {
pub fn format_duration(duration: impl Borrow<Duration>) -> String {
// Get the total number of seconds, return immediately if zero or less
let mut secs = duration.num_seconds();
let mut secs = duration.borrow().num_seconds();
if secs <= 0 {
return "now".into();
}